Skip to content
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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tom1299
Copy link
Contributor

@tom1299 tom1299 commented Feb 12, 2025

Note that this pull request is just a draft for implementing the functionality described in the enhancement #837


time.AfterFunc(pauseDuration, func() {
deployment, err := clients.KubernetesClient.AppsV1().Deployments(itemNamespace).Get(context.TODO(), itemName, metav1.GetOptions{})
if err != nil {
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

@tom1299 tom1299 Feb 19, 2025

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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 ?

Copy link
Contributor

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

@karl-johan-grahn karl-johan-grahn changed the title Add pausing deployment rollouts Draft: Add pausing deployment rollouts Feb 13, 2025
@tom1299 tom1299 changed the title Draft: Add pausing deployment rollouts Add pausing deployment rollouts Feb 28, 2025
@karl-johan-grahn karl-johan-grahn marked this pull request as draft March 12, 2025 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants