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

fix: wait until deployment stabilizes to set status Ready #718

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

avorima
Copy link
Contributor

@avorima avorima commented Mar 11, 2025

I noticed some connection interruptions when connecting to the kube-apiserver after a version update.
This change aims to improve this by making sure that all pods are updated and ready before marking the version status as Ready.

@avorima avorima force-pushed the fix-version-ready branch from 0067e2b to 0406f63 Compare March 11, 2025 09:13
Copy link

netlify bot commented Mar 11, 2025

Deploy Preview for kamaji-documentation canceled.

Name Link
🔨 Latest commit 0067e2b
🔍 Latest deploy log https://app.netlify.com/sites/kamaji-documentation/deploys/67cffec2841281000826ea69

Copy link

netlify bot commented Mar 11, 2025

Deploy Preview for kamaji-documentation canceled.

Name Link
🔨 Latest commit 0406f63
🔍 Latest deploy log https://app.netlify.com/sites/kamaji-documentation/deploys/67cffed37e371c0008dc52fa

@avorima avorima marked this pull request as ready for review March 11, 2025 09:35
@@ -106,6 +107,20 @@ func (r *KubernetesDeploymentResource) isProgressingUpgrade() bool {
return true
}

// An update is complete when new pods are ready and old pods deleted.
desired := ptr.Deref(r.resource.Spec.Replicas, 2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Deref dereferences ptr and returns the value it points to if no nil, or else
// returns def.
func Deref[T any](ptr *T, def T) T {

Why did you pick 2 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because it's the default. in reality this should never use the default because the field is always set, so i could just dereference. but if this code is ever unit tested it would be something to look out for

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