-
Notifications
You must be signed in to change notification settings - Fork 6.5k
fix: #20183 preserve syncOptions when rolling back from the UI #21871
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
Conversation
a rollback initiatiated from the UI shouldn't wipe out syncOptions if set Signed-off-by: Alex Eftimie <[email protected]>
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
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.
LGTM!!
ui/src/app/applications/components/application-details/application-details.tsx
Outdated
Show resolved
Hide resolved
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.
Can you test the suggestions from @linghaoSu?
…tion-details.tsx Co-authored-by: Linghao Su <[email protected]> Signed-off-by: Alex Eftimie <[email protected]>
ui/src/app/applications/components/application-details/application-details.tsx
Outdated
Show resolved
Hide resolved
…tion-details.tsx Signed-off-by: Alex Eftimie <[email protected]>
ui/src/app/applications/components/application-details/application-details.tsx
Outdated
Show resolved
Hide resolved
…tion-details.tsx Signed-off-by: Alex Eftimie <[email protected]>
| if (needDisableRollback) { | ||
| const update = JSON.parse(JSON.stringify(application)) as appModels.Application; | ||
| update.spec.syncPolicy = {automated: null}; | ||
| update.spec.syncPolicy.automated = null; |
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.
at this point in code (see needDisableRollback) we know that update.spec.syncPolicy.automated is set to something not null. this is why we can set it to null, while leaving the rest of syncPolicy (syncOptions) unchanged.
|
I've updated the PR description with testing instructions. also raised it 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.
LGTM
|
@ishitasequeira any chance this can be merged 🙏 ? |
|
/cherry-pick 2.14 |
argoproj#21871) Signed-off-by: Alex Eftimie <[email protected]> Co-authored-by: Linghao Su <[email protected]> Signed-off-by: Hapshanko <[email protected]>
a rollback initiated from the UI shouldn't remove
syncOptionsif they are set.note: this is only an issue in the UI, because the UI will first disable auto-sync, then rolllback. during the auto sync disabling, the syncOptions are accidentally removed. if the rollback is initiated via CLI, then this code preserves existing sync options.
fixes: #20183
Steps to reproduce for tester
spec.syncPolicy.syncOptionsto anything, for instance:[ "CreateNamespace=true" ]spec.syncPolicy.automatedto an object)spec.syncPolicy.syncOptionsto still have your settings at point 1.Before this PR, the syncOptions will be gone. After it, they would be preserved.
Checklist: