Skip to content

Add pausing deployment rollouts#838

Closed
tom1299 wants to merge 10 commits into
stakater:masterfrom
tom1299:add_pause_rollout
Closed

Add pausing deployment rollouts#838
tom1299 wants to merge 10 commits into
stakater:masterfrom
tom1299:add_pause_rollout

Conversation

@tom1299
Copy link
Copy Markdown
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

Comment thread 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 {
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@galkindmitrii
Copy link
Copy Markdown

galkindmitrii commented Apr 22, 2025

Hi @karl-johan-grahn @tom1299

Any chance on getting this reviewed and merged?

This feature will be super helpful :)

Thanks!

@tom1299 tom1299 force-pushed the add_pause_rollout branch from 226a67a to 52be3b7 Compare April 26, 2025 06:20
@tom1299 tom1299 force-pushed the add_pause_rollout branch from 52be3b7 to 785e7bb Compare April 26, 2025 06:56
@tom1299
Copy link
Copy Markdown
Contributor Author

tom1299 commented Apr 26, 2025

@galkindmitrii @karl-johan-grahn I would be happy to continue working on this. I made some smaller refactorings but would now say it could be reviewed. Regarding documentation I am not sure where I should add it.
Any feedback is welcome 🙂

@tom1299 tom1299 marked this pull request as ready for review April 26, 2025 07:30
@tom1299 tom1299 marked this pull request as draft April 26, 2025 07:31
@tom1299
Copy link
Copy Markdown
Contributor Author

tom1299 commented Jul 4, 2025

@karl-johan-grahn I was wondering if we might still be able to get this pull request merged. I've taken some time to rebase the branch on master, refactored the code to support patching resources, moved most of the logic into a dedicated Go file, and added some additional tests.
I understand that your time is limited, and this is a fairly large PR, so I really appreciate any feedback. Thanks in advance for having a look.
(Of course I would cleanup the commit history and do some coming house keeping as well)

@tom1299 tom1299 closed this Jul 15, 2025
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.

3 participants