-
Notifications
You must be signed in to change notification settings - Fork 20
feat: block the duplicated resource select #14
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
feat: block the duplicated resource select #14
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.
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Files not reviewed (1)
- Makefile: Language not supported
Comments suppressed due to low confidence (2)
pkg/controllers/clusterresourceplacement/resource_selector.go:142
- [nitpick] Verify that the descending sort order based on the namespace/name string comparison is intentional. If an ascending order is preferred, consider reversing the comparison condition.
return strings.Compare(fmt.Sprintf("%s/%s", obj1.GetNamespace(), obj1.GetName()), fmt.Sprintf("%s/%s", obj2.GetNamespace(), obj2.GetName())) > 0
pkg/controllers/clusterresourceplacement/resource_selector.go:116
- The error message for a duplicate resource is generic. Consider enhancing it with additional context to help users identify and resolve the duplicate resource selection.
if _, exist := resourceMap[ri]; exist {
| }, eventuallyDuration, eventuallyInterval).Should(Succeed(), "Failed to update resourceOverride %s with non-existent label key", roName) | ||
|
|
||
| By("Verify the CRP status should have one cluster failed to override while the rest stuck in rollout") | ||
| // TODO: need to construct the expected status |
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.
Does crpStatusWithOverrideUpdatedFailedActual work here, like line 1054?
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.
not really, crpStatusWithOverrideUpdatedFailedActual failed everywhere while this one only failed at one cluster and the rest of the rollout is stuck (to prevent the wipe out of all the copies)
Signed-off-by: Ryan Zhang <zhangryan@microsoft.com>
Signed-off-by: Ryan Zhang <zhangryan@microsoft.com>
Signed-off-by: Ryan Zhang <zhangryan@microsoft.com>
1c026f5 to
a0836a3
Compare
Signed-off-by: Ryan Zhang <zhangryan@microsoft.com>
a0836a3 to
4b13c27
Compare
Description of your changes
Block user from specifying the same resource in the resource select section in the CRP.
I have:
make reviewableto ensure this PR is ready for review.How has this code been tested
UT/E2E
Special notes for your reviewer