-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Make configmapref check case insensitive #6804
Make configmapref check case insensitive #6804
Conversation
/kind changelog-not-required |
5cc0588
to
90362f0
Compare
Signed-off-by: Anshul Ahuja <anshul.ahu@gmail.com>
90362f0
to
5e94d91
Compare
Codecov Report
@@ Coverage Diff @@
## main #6804 +/- ##
=======================================
Coverage 60.45% 60.46%
=======================================
Files 242 242
Lines 26031 26033 +2
=======================================
+ Hits 15738 15740 +2
Misses 9187 9187
Partials 1106 1106
|
@@ -476,7 +477,7 @@ func (b *backupReconciler) prepareBackupRequest(backup *velerov1api.Backup, logg | |||
request.Status.ValidationErrors = append(request.Status.ValidationErrors, "encountered labelSelector as well as orLabelSelectors in backup spec, only one can be specified") | |||
} | |||
|
|||
if request.Spec.ResourcePolicy != nil && request.Spec.ResourcePolicy.Kind == resourcepolicies.ConfigmapRefType { | |||
if request.Spec.ResourcePolicy != nil && strings.EqualFold(request.Spec.ResourcePolicy.Kind, resourcepolicies.ConfigmapRefType) { |
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.
Is it possible to add a simple test just to check this new behavior?
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.
Updated the test case for resourcemodifier, that should be enough coverage.
For resourcepolicies, it is not trivial to add for now, since there are no controller side tests from what I can see.
Signed-off-by: Anshul Ahuja <anshulahuja@microsoft.com>
@anshulahuja98 |
When adding the reference through CLI it doesn't matter, but if we try using backupcr / restore CR, it is easy to make a case choice such as "ConfigMap", and that will not log any error, it will lead to skipping of resource mod/policies silently. It's a minor change just for ease and avoiding mistakes. |
Do you see any concern with this @reasonerjt ? |
@reasonerjt Any concerns with this PR ? We encountered this issue in our testing as well. |
@anshulahuja98 It would be really great to get this in for velero 1.12.2 |
* Make configmapref check case insensitive Signed-off-by: Anshul Ahuja <anshul.ahu@gmail.com> * update resourcemodfier test case to validate case Signed-off-by: Anshul Ahuja <anshulahuja@microsoft.com> --------- Signed-off-by: Anshul Ahuja <anshul.ahu@gmail.com> Signed-off-by: Anshul Ahuja <anshulahuja@microsoft.com> Co-authored-by: Anshul Ahuja <anshulahuja@microsoft.com>
* Make configmapref check case insensitive * update resourcemodfier test case to validate case --------- Signed-off-by: Anshul Ahuja <anshul.ahu@gmail.com> Signed-off-by: Anshul Ahuja <anshulahuja@microsoft.com> Co-authored-by: Anshul Ahuja <anshulahuja@microsoft.com>
Thank you for contributing to Velero!
Please add a summary of your change
For resource modifier and resource policies, make the check for configmap reference case insensitive.
Does your change fix a particular issue?
Fixes #(issue)
Please indicate you've done the following:
/kind changelog-not-required
as a comment on this pull request.site/content/docs/main
.