-
Notifications
You must be signed in to change notification settings - Fork 495
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
[node-agent] Perform hosts probing on RegistryConfig.Hosts
change
#11008
base: master
Are you sure you want to change the base?
[node-agent] Perform hosts probing on RegistryConfig.Hosts
change
#11008
Conversation
/assign |
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.
Nit
@@ -315,3 +320,16 @@ func computeContainerdRegistryDiffs(newRegistries, oldRegistries []extensionsv1a | |||
|
|||
return r | |||
} | |||
|
|||
func suppressHostsProbing(newRegistries, oldRegistries []extensionsv1alpha1.RegistryConfig) { | |||
for i := 0; i < len(newRegistries); i++ { |
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.
for i := 0; i < len(newRegistries); i++ { | |
for i := range newRegistries { |
@dimitar-kostadinov: The following tests failed, say
Full PR test history. Your PR dashboard. Command help for this repository. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
The Gardener project currently lacks enough active contributors to adequately respond to all PRs.
You can:
/lifecycle stale |
/remove-lifecycle stale |
func suppressHostsProbing(newRegistries, oldRegistries []extensionsv1alpha1.RegistryConfig) { | ||
for i := 0; i < len(newRegistries); i++ { | ||
if ptr.Deref(newRegistries[i].ReadinessProbe, false) { | ||
index := slices.IndexFunc(oldRegistries, func(config extensionsv1alpha1.RegistryConfig) bool { | ||
return newRegistries[i].Upstream == config.Upstream | ||
}) | ||
if index != -1 && reflect.DeepEqual(newRegistries[i].Hosts, oldRegistries[index].Hosts) { | ||
newRegistries[i].ReadinessProbe = ptr.To(false) | ||
} | ||
} | ||
} | ||
} |
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.
There should be better ways to do achieve this.
Right now, you are modifying the readinessProbe field of the registry config fetched from the OSC. It looks like hack/anti-pattern to modify the desired state of your object.
Instead:
- You could store in
type containerdRegistries struct { - Check how files are being applied -
type files struct { changed
files are set to new files on the initial reconciliation. After that,changed
files contains only the changed files. Can something similar work for registries as well? If yes, we could always probe the changed registries.
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.
https://github.com/ialidzhikov/gardener/tree/enh/node_agent_osc_hosts_probing-poc: PoC for applying the registries similar to how files are applied (the 2nd bullet from #11008 (comment)).
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
How to categorize this PR?
/area robustness
/kind enhancement
What this PR does / why we need it:
There are cases where
RegistryConfig.Hosts
is changed, e.g.CACerts
is added or rotated, the mirrorURL
is updated, etc. Is such cases the hosts probing should be performed to ensure that new configuration is valid.Which issue(s) this PR fixes:
Part of gardener-extension-registry-cache/issues/290
Special notes for your reviewer:
N/A
Release note: