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

Support multiple ImagePullSecrets #575

Merged
merged 2 commits into from
Jul 31, 2024
Merged

Conversation

chunter0
Copy link
Contributor

@chunter0 chunter0 commented Jul 29, 2024

Add support for multiple image pull secrets

Manual Helm Testing

cat <<-EOF | helm template codegen/test/chart/image-pull-secrets -f - | yq 'select(.kind == "Deployment") | .spec.template.spec.imagePullSecrets'
painter:
  enabled: true
  image:
    pullSecret: a-registry
EOF
cat <<-EOF | helm template codegen/test/chart/image-pull-secrets -f - | yq 'select(.kind == "Deployment") | .spec.template.spec.imagePullSecrets'
painter:
  enabled: true
  imagePullSecrets:
  - name: b-registry
EOF
cat <<-EOF | helm template codegen/test/chart/image-pull-secrets -f - | yq 'select(.kind == "Deployment") | .spec.template.spec.imagePullSecrets'
painter:
  enabled: true
  image:
    pullSecret: a-registry
  imagePullSecrets:
  - name: b-registry
EOF

BOT NOTES:
resolves #574

@solo-changelog-bot
Copy link

Issues linked to changelog:
#574

@chunter0 chunter0 force-pushed the chunter/image-pull-secrets branch from 71072f5 to 737b43d Compare July 30, 2024 04:35
@chunter0 chunter0 requested a review from josh-pritchard July 30, 2024 15:31
Copy link
Contributor

@josh-pritchard josh-pritchard left a comment

Choose a reason for hiding this comment

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

Can we open a draft against GME where you generate the chart against this locally? Then you could verify the templating is correct there.

{{- if $[[ $operatorVar ]].imagePullSecrets }}
{{- $pullSecrets = concat $pullSecrets $[[ $operatorVar ]].imagePullSecrets -}}
{{- end }}
{{- (dict "imagePullSecrets" $pullSecrets) | toYaml | nindent 6 }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is going to render right, imagePullSecrets is an array not a dict. Maybe something like this?

Suggested change
{{- (dict "imagePullSecrets" $pullSecrets) | toYaml | nindent 6 }}
{{- if gt (len $pullSecrets) 0 -}}
imagePullSecrets:
{{- toYaml $pullSecrets | nindent 8 }}
{{- end}}

Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if the indent is right

@soloio-bulldozer soloio-bulldozer bot merged commit 80d0264 into main Jul 31, 2024
3 checks passed
@soloio-bulldozer soloio-bulldozer bot deleted the chunter/image-pull-secrets branch July 31, 2024 15:31
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.

Support ImagePullSecrets as array type
3 participants