-
Notifications
You must be signed in to change notification settings - Fork 295
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 controller generating cilium manifests with registry mirror #7170
Fix controller generating cilium manifests with registry mirror #7170
Conversation
Skipping CI for Draft Pull Request. |
1b8aa61
to
6a9ada4
Compare
/test all |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #7170 +/- ##
==========================================
+ Coverage 71.58% 71.65% +0.07%
==========================================
Files 545 548 +3
Lines 42362 42494 +132
==========================================
+ Hits 30324 30451 +127
- Misses 10345 10349 +4
- Partials 1693 1694 +1 ☔ View full report in Codecov by Sentry. |
/test eks-anywhere-presubmit |
92b2414
to
c1d332a
Compare
01bdf87
to
09d5618
Compare
/test eks-anywhere-presubmit |
…om management cluster
…id of client under pkg/cluster/helm
…implement helm executable builder
f0bedd7
to
a6086df
Compare
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.
/lgtm
89e48fd
to
49e7146
Compare
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cxbrowne1207 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cherry-pick release-0.18 |
@cxbrowne1207: #7170 failed to apply on top of branch "release-0.18":
In response to this:
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/test-infra repository. |
/cherry-pick release-0.17 |
@cxbrowne1207: #7170 failed to apply on top of branch "release-0.17":
In response to this:
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/test-infra repository. |
…7170) * generate helm from a factory to load registry mirror configuration from management cluster * move helmfactory to helm package (no other changes) * decoupled executables from helm factory, renamed helm tyoes and got rid of client under pkg/cluster/helm * changes to other files due to change executable builder signature to implement helm executable builder * add helm env client factory implementation for cilium.HelmClientFactory * remove helm.ClientFactory dependency on ops it doesn't need * rename GetClientForCluster -> Get and addressed other PR comments * move WithHelmClientFactory to controller factory and build cilium Templater there and added comments * add generated files * dropping registry client and executableclient interfaces in favor of just client * re-build client only when registry changes * fix linting error * moved WithEnv implementaton details back to executable helm * add new helm executeable unit test * always return new client in helm client factory and add comment to ProxyConfig * refactored ExecutableBuilder -> ClientBuilder * extract code from poluted pkg/helm/factory.go file into client.go and config.go * remove helmClient from struct. not needed to store * referencing implementation instead of interface in factory dependencies * change joinEnv to mergeMap
…7170) * generate helm from a factory to load registry mirror configuration from management cluster * move helmfactory to helm package (no other changes) * decoupled executables from helm factory, renamed helm tyoes and got rid of client under pkg/cluster/helm * changes to other files due to change executable builder signature to implement helm executable builder * add helm env client factory implementation for cilium.HelmClientFactory * remove helm.ClientFactory dependency on ops it doesn't need * rename GetClientForCluster -> Get and addressed other PR comments * move WithHelmClientFactory to controller factory and build cilium Templater there and added comments * add generated files * dropping registry client and executableclient interfaces in favor of just client * re-build client only when registry changes * fix linting error * moved WithEnv implementaton details back to executable helm * add new helm executeable unit test * always return new client in helm client factory and add comment to ProxyConfig * refactored ExecutableBuilder -> ClientBuilder * extract code from poluted pkg/helm/factory.go file into client.go and config.go * remove helmClient from struct. not needed to store * referencing implementation instead of interface in factory dependencies * change joinEnv to mergeMap
…7170) * generate helm from a factory to load registry mirror configuration from management cluster * move helmfactory to helm package (no other changes) * decoupled executables from helm factory, renamed helm tyoes and got rid of client under pkg/cluster/helm * changes to other files due to change executable builder signature to implement helm executable builder * add helm env client factory implementation for cilium.HelmClientFactory * remove helm.ClientFactory dependency on ops it doesn't need * rename GetClientForCluster -> Get and addressed other PR comments * move WithHelmClientFactory to controller factory and build cilium Templater there and added comments * add generated files * dropping registry client and executableclient interfaces in favor of just client * re-build client only when registry changes * fix linting error * moved WithEnv implementaton details back to executable helm * add new helm executeable unit test * always return new client in helm client factory and add comment to ProxyConfig * refactored ExecutableBuilder -> ClientBuilder * extract code from poluted pkg/helm/factory.go file into client.go and config.go * remove helmClient from struct. not needed to store * referencing implementation instead of interface in factory dependencies * change joinEnv to mergeMap
…7170) * generate helm from a factory to load registry mirror configuration from management cluster * move helmfactory to helm package (no other changes) * decoupled executables from helm factory, renamed helm tyoes and got rid of client under pkg/cluster/helm * changes to other files due to change executable builder signature to implement helm executable builder * add helm env client factory implementation for cilium.HelmClientFactory * remove helm.ClientFactory dependency on ops it doesn't need * rename GetClientForCluster -> Get and addressed other PR comments * move WithHelmClientFactory to controller factory and build cilium Templater there and added comments * add generated files * dropping registry client and executableclient interfaces in favor of just client * re-build client only when registry changes * fix linting error * moved WithEnv implementaton details back to executable helm * add new helm executeable unit test * always return new client in helm client factory and add comment to ProxyConfig * refactored ExecutableBuilder -> ClientBuilder * extract code from poluted pkg/helm/factory.go file into client.go and config.go * remove helmClient from struct. not needed to store * referencing implementation instead of interface in factory dependencies * change joinEnv to mergeMap
… (#7184) * generate helm from a factory to load registry mirror configuration from management cluster * move helmfactory to helm package (no other changes) * decoupled executables from helm factory, renamed helm tyoes and got rid of client under pkg/cluster/helm * changes to other files due to change executable builder signature to implement helm executable builder * add helm env client factory implementation for cilium.HelmClientFactory * remove helm.ClientFactory dependency on ops it doesn't need * rename GetClientForCluster -> Get and addressed other PR comments * move WithHelmClientFactory to controller factory and build cilium Templater there and added comments * add generated files * dropping registry client and executableclient interfaces in favor of just client * re-build client only when registry changes * fix linting error * moved WithEnv implementaton details back to executable helm * add new helm executeable unit test * always return new client in helm client factory and add comment to ProxyConfig * refactored ExecutableBuilder -> ClientBuilder * extract code from poluted pkg/helm/factory.go file into client.go and config.go * remove helmClient from struct. not needed to store * referencing implementation instead of interface in factory dependencies * change joinEnv to mergeMap
… (#7185) * generate helm from a factory to load registry mirror configuration from management cluster * move helmfactory to helm package (no other changes) * decoupled executables from helm factory, renamed helm tyoes and got rid of client under pkg/cluster/helm * changes to other files due to change executable builder signature to implement helm executable builder * add helm env client factory implementation for cilium.HelmClientFactory * remove helm.ClientFactory dependency on ops it doesn't need * rename GetClientForCluster -> Get and addressed other PR comments * move WithHelmClientFactory to controller factory and build cilium Templater there and added comments * add generated files * dropping registry client and executableclient interfaces in favor of just client * re-build client only when registry changes * fix linting error * moved WithEnv implementaton details back to executable helm * add new helm executeable unit test * always return new client in helm client factory and add comment to ProxyConfig * refactored ExecutableBuilder -> ClientBuilder * extract code from poluted pkg/helm/factory.go file into client.go and config.go * remove helmClient from struct. not needed to store * referencing implementation instead of interface in factory dependencies * change joinEnv to mergeMap
Issue #, if available:
Description of changes:
The CNI reconciler fails to generate cilium manifests in an airgapped environment because it tries to fetch the image from public.ecr.aws instead of the registry mirror. This is because the registry mirror for the helm executable reference in the cilium templater is never set when managing a cluster using FLC, so when generating the manifests helm , the logic that replaces the host in the image uri is skipped
This PR addresses the issue by enabling the controller to handle helm charts when reconciling the CNI is to construct the Helm client in the controller. Instead of depending directly on the Helm executable client, we inject a
HelmFactory
to the cilium templater. We can then use theHelmFactory
to create an instance of aHelmClient
configured for the registry mirror of the cluster.Testing (if applicable):
Documentation added/planned (if applicable):
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.