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

deployment.Reconcile and daemonset.Reconcile lead to unnecessary updates #3423

Closed
pebrc opened this issue Jul 13, 2020 · 1 comment
Closed
Labels
>bug Something isn't working

Comments

@pebrc
Copy link
Collaborator

pebrc commented Jul 13, 2020

We include the full resource into the hash calculation including the ResourceVersion that leads to an unnecessary update cycle where we re-hash and update the resource again after an update due to the resource version changing.

func WithTemplateHash(d appsv1.DaemonSet) appsv1.DaemonSet {
dCopy := *d.DeepCopy()
dCopy.Labels = hash.SetTemplateHashLabel(dCopy.Labels, dCopy)
return dCopy

func WithTemplateHash(d appsv1.Deployment) appsv1.Deployment {
dCopy := *d.DeepCopy()
dCopy.Labels = hash.SetTemplateHashLabel(dCopy.Labels, dCopy)
return dCopy

This behaviour is actually hidden in our unit tests, because FakeClient ignores ResourceVersion and does not fully simulate a real client (until controller-runtime 0.6.1 at least)

@pebrc pebrc added the >bug Something isn't working label Jul 13, 2020
@pebrc
Copy link
Collaborator Author

pebrc commented Jul 15, 2020

This is a non-issue. I misinterpreted the effects of this bug kubernetes-sigs/controller-runtime#926

@pebrc pebrc closed this as completed Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant