-
Notifications
You must be signed in to change notification settings - Fork 532
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
Add pausing deployment rollouts #838
base: master
Are you sure you want to change the base?
Conversation
internal/pkg/handler/upgrade.go
Outdated
|
||
time.AfterFunc(pauseDuration, func() { | ||
deployment, err := clients.KubernetesClient.AppsV1().Deployments(itemNamespace).Get(context.TODO(), itemName, metav1.GetOptions{}) | ||
if err != nil { |
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.
seven levels of if
clauses - decrease the cyclomatic complexity
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.
@karl-johan-grahn Thanks for the review. The ode is really not that good. As I wrote in the issue this was just code to prove that it works. Would it be ok to add such a feature in general ? I would then of course refactor the code and add appropriate tests.
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.
@karl-johan-grahn I refactored the code in general:
- Reduced complexity / readability in general
- Put the code into a separate file instead of upgrade.go (separation of concerns)
- Reduced the number of changes introduced in PerformAction
- Refactor annotation to flags.go
- Add test cases for annotation and environment variable reload strategy
Could you please have a look at the changes ? Thanks in advance.
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.
Pull requests are very much welcome! But we will not add any temporary or work-in-progress changes, so you need to work on it until it is production-ready. Thousands of customers use the tool in production so it needs to go through thorough work before being merged.
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.
@karl-johan-grahn Of course. I would just need a little review / hints what might still be enhanced. Do you have any suggestions ?
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.
We will review it and you have to be a little patient, we only spend around 1 h each week on all open source repositories
4f4dda5
to
8359d87
Compare
Note that this pull request is just a draft for implementing the functionality described in the enhancement #837