-
Notifications
You must be signed in to change notification settings - Fork 82
Match labels #1894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: oadp-dev
Are you sure you want to change the base?
Match labels #1894
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Variable Declaration Style
(tests/e2e/backup_restore_suite_test.go:167-169):
- Unnecessary variable pre-declaration could be simplified
// Current
var nsRequiresResticDCWorkaround bool
var err error
nsRequiresResticDCWorkaround, err =
lib.NamespaceRequiresResticDCWorkaround(...)
// Better
nsRequiresResticDCWorkaround, err :=
lib.NamespaceRequiresResticDCWorkaround(...)
- Label Extraction Logic
(tests/e2e/backup_restore_suite_test.go:188-194):
- Only uses first label from map, which may cause unexpected behavior
- Should either support multiple labels or document single-label
limitation
- Consider using metav1.LabelSelector consistently
Signed-off-by: Wesley Hayutin <[email protected]>
Signed-off-by: Wesley Hayutin <[email protected]>
/retest |
Is label test still valid for hcp plugin? |
@kaovilai the backup via label is NOT FOR hypershift. However I'm sure you agree that backing up apps ( our sample apps ) should work even if the hypershift plugin is configured in the dpa. :) |
/test 4.19-e2e-test-aws |
Note This comment was generated with Claude Critical Pod Ownership Conflict IssueI've identified a critical pod ownership conflict in the MySQL persistent test configuration that could cause issues with pod management. Problem: In the file
Root Cause: The selectors are not sufficiently unique to distinguish between pods managed by different controller types. Recommended Fix: Make the selectors more specific by adding distinct labels to differentiate between Deployment and DeploymentConfig managed pods. For example:
This ensures each controller only manages its intended pods and prevents ownership conflicts. |
/retest |
@weshayutin: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Selector Conflict Found - Changes Requested
Note
Responses generated with Claude
Summary
While this PR successfully implements label-based backup functionality, there's a critical selector conflict in mysql-persistent-csi.yaml
that needs to be resolved.
Issue
Two controllers have overlapping selectors that can cause race conditions and pod management conflicts:
- Deployment
mysql
:matchLabels: app: todolist
- DeploymentConfig
todolist
:selector: app: todolist, service: todolist
Required Changes
Please update the Deployment selector to be more specific and avoid the overlap. See the inline comment for specific recommendations.
Otherwise
The implementation looks good:
- ✅ Clean label-based backup functionality
- ✅ Proper test coverage
- ✅ Well-structured YAML manifests
Once the selector conflict is resolved, this should be ready to merge!
@claude, perhaps you are correct.
I don't see why we care in this case. Help me understand why it's important to block this pr. The key/value pair "app: todolist" is used for selectors on the backup and restore. The key/value pair service: todolist is to label the service. Other than the value string, WHY SHOULD WE CARE? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
visiack still works from meet
OK.. so @kaovilai and I jumped on a call to check this.
So the additional todolist apps are having problems connecting to the db. I don't think that is related to the label though. Eventually all the pods can be running. I'm going to investigate the proper way to label an app while also ensuring services etc. work properly.
IMHO this is good to land as is and I'll follow up w/ a
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
visiack still works in meet
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kaovilai, weshayutin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ My comments would've applied if there's no ignore mechanism here. |
spec: | ||
labelSelector: | ||
matchLabels: | ||
app: todolist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the label should be unique across different tests and deployments?
This may have consequences if running in parallel:
https://github.com/openshift/oadp-operator/blob/oadp-dev/tests/e2e/sample-applications/mongo-persistent/mongo-persistent-csi.yaml#L42
Secondly how about also using multiple label selectors implemented by (note this is OR operator):
vmware-tanzu/velero#4650
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so mysql specific todolist label?
Why the changes were made
Test use and changes for https://issues.redhat.com/browse/OADP-6248
Depends-On: openshift/hypershift-oadp-plugin#96
How to test the changes made
make test-e2e GINKGO_ARGS="--ginkgo.focus='MySQL-label application CSI'"
recreates hypershift plugin bug where restores fail w/
""Namespace mysql, resource restore error: error preparing secrets/mysql/mysql: rpc error: code = Unknown desc = backup or included namespaces is nil" "