-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Allows multiple imagePullSecrets in the helm chart. #4656
Conversation
Hi @AlessioCasco I checked out your branch, and it seems to work for me! One thing I noticed, though, is that we currently don't have a mechanism in place to prevent both One possible solution could be to introduce some restrictions to the JSON schema, like so:
|
Hi! @haywoodsh AlternativesIf the solution doesn't look good to you we can also do:
TestsI've tested all combinations and all seem to work well now: Both setimagePullSecretName: "test"
imagePullSecretsNames: [alessio,casco] Returns walk.go:74: found symbolic link in path: /Users/alessio/gitrep/AlessioCasco/kubernetes-ingress/charts/nginx-ingress/crds resolves to /Users/alessio/gitrep/AlessioCasco/kubernetes-ingress/config/crd/bases. Contents of linked file included and used
Error: values don't meet the specifications of the schema(s) in the following chart(s):
nginx-ingress:
- controller.serviceAccount: Must validate one and only one schema (oneOf)
- controller.serviceAccount.imagePullSecretName: String length must be less than or equal to 0 ---0--- Both nullimagePullSecretName: ""
imagePullSecretsNames: [] renders apiVersion: v1
kind: ServiceAccount
metadata:
name: nginx-nginx-ingress
namespace: default
labels:
helm.sh/chart: nginx-ingress-1.0.2
app.kubernetes.io/name: nginx-ingress
app.kubernetes.io/instance: nginx
app.kubernetes.io/version: "3.3.2"
app.kubernetes.io/managed-by: Helm
--- ---0--- Only one nullimagePullSecretName: "" renders apiVersion: v1
kind: ServiceAccount
metadata:
name: nginx-nginx-ingress
namespace: default
labels:
helm.sh/chart: nginx-ingress-1.0.2
app.kubernetes.io/name: nginx-ingress
app.kubernetes.io/instance: nginx
app.kubernetes.io/version: "3.3.2"
app.kubernetes.io/managed-by: Helm
--- ---0--- The other one nullimagePullSecretsNames: [] renders apiVersion: v1
kind: ServiceAccount
metadata:
name: nginx-nginx-ingress
namespace: default
labels:
helm.sh/chart: nginx-ingress-1.0.2
app.kubernetes.io/name: nginx-ingress
app.kubernetes.io/instance: nginx
app.kubernetes.io/version: "3.3.2"
app.kubernetes.io/managed-by: Helm
--- ---0--- No values definedapiVersion: v1
kind: ServiceAccount
metadata:
name: nginx-nginx-ingress
namespace: default
labels:
helm.sh/chart: nginx-ingress-1.0.2
app.kubernetes.io/name: nginx-ingress
app.kubernetes.io/instance: nginx
app.kubernetes.io/version: "3.3.2"
app.kubernetes.io/managed-by: Helm
--- ---0--- Only array set imagePullSecretsNames: [alessio,casco] renders kind: ServiceAccount
metadata:
name: nginx-nginx-ingress
namespace: default
labels:
helm.sh/chart: nginx-ingress-1.0.2
app.kubernetes.io/name: nginx-ingress
app.kubernetes.io/instance: nginx
app.kubernetes.io/version: "3.3.2"
app.kubernetes.io/managed-by: Helm
imagePullSecrets:
- name: alessio
- name: casco
--- ---0--- Only array set + null the other imagePullSecretName: ""
imagePullSecretsNames: [alessio,casco] renders kind: ServiceAccount
metadata:
name: nginx-nginx-ingress
namespace: default
labels:
helm.sh/chart: nginx-ingress-1.0.2
app.kubernetes.io/name: nginx-ingress
app.kubernetes.io/instance: nginx
app.kubernetes.io/version: "3.3.2"
app.kubernetes.io/managed-by: Helm
imagePullSecrets:
- name: alessio
- name: casco
--- ---0--- Null the array + set the stringimagePullSecretName: "test"
imagePullSecretsNames: [] renders apiVersion: v1
kind: ServiceAccount
metadata:
name: nginx-nginx-ingress
namespace: default
labels:
helm.sh/chart: nginx-ingress-1.0.2
app.kubernetes.io/name: nginx-ingress
app.kubernetes.io/instance: nginx
app.kubernetes.io/version: "3.3.2"
app.kubernetes.io/managed-by: Helm
imagePullSecrets:
- name: test ---0--- Only string setimagePullSecretName: "test" renders apiVersion: v1
kind: ServiceAccount
metadata:
name: nginx-nginx-ingress
namespace: default
labels:
helm.sh/chart: nginx-ingress-1.0.2
app.kubernetes.io/name: nginx-ingress
app.kubernetes.io/instance: nginx
app.kubernetes.io/version: "3.3.2"
app.kubernetes.io/managed-by: Helm
imagePullSecrets:
- name: test
--- |
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.
@AlessioCasco thank you very much for providing such comprehensive tests!
I've approved & run the pipeline.
There is one reported linter issue with charts/nginx-ingress/README.md
that needs to be fixed and then we should be good to merge 🙂
Hi! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4656 +/- ##
=======================================
Coverage 52.09% 52.09%
=======================================
Files 59 59
Lines 17033 17033
=======================================
Hits 8873 8873
Misses 7862 7862
Partials 298 298 ☔ View full report in Codecov by Sentry. |
Hi! If you roughly know already when you want to deprecate |
@AlessioCasco sounds good, and thank you again for contributing! 🎉 |
Hello
Proposed changes
This allows multiple
imagePullSecrets
in the helm chart as discussed in #4589Adds 1 new helm value:
imagePullSecretsNames
that with time will replaceimagePullSecretName
.For compatibility reasons, both values work now.
I have not edited any release or changelog file for now, let me know if this is automated or if you want me to add the info.
Tests:
imagePullSecretsNames
to something other than an array, raises:imagePullSecretName
to "" andimagePullSecretsNames
to[]
renders:imagePullSecretName
to "secret_1" andimagePullSecretsNames
to[]
renders:imagePullSecretName
to "" andimagePullSecretsNames
to[secret_2_from_list]
renders:imagePullSecretName
to "secret_1" andimagePullSecretsNames
to[secret_2_from_list]
renders:imagePullSecretName
to "secret_1" andimagePullSecretsNames
to[secret_2_from_list, secret_3_from_list]
renders:Checklist
Before creating a PR, run through this checklist and mark each as complete.