fix: correct imagePullSecrets schema to use LocalObjectReference format#93
Conversation
Schema declared imagePullSecrets as array of strings, but Kubernetes
requires array of LocalObjectReference objects ({name: string}).
Fixes schema for global, graylog.image, and datanode.image.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes Helm values schema validation for imagePullSecrets by aligning the schema with Kubernetes’ required []LocalObjectReference format (objects containing a name field), preventing users from needing --skip-schema-validation.
Changes:
- Update
global.imagePullSecretsschema items fromstringto{ name: string }withnamerequired. - Update
graylog.image.imagePullSecretsschema to require[{ name: ... }]items (instead of an untyped array). - Update
datanode.image.imagePullSecretsschema to require[{ name: ... }]items (instead of an untyped array).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
monrax
left a comment
There was a problem hiding this comment.
We could also allow for both.
Currently, this takes {"name": ... } objects, leeping a 1:1 correspondence with the imagePullSecrets in the renderedPodSpec:
{{- with .Values.graylog.image.imagePullSecrets | default .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}We could also allow string values:
{{- range (.Values.graylog.image.imagePullSecrets | default .Values.global.imagePullSecrets) }}
imagePullSecrets:
- name: {{ . }}
{{- end }}But we would need a helper to merge both kinds depending on the passed type. More complexity that can be added in a follow-up. This works for now.
LGTM 🚀 (thank you for your patience @williamtrelawny!)
Summary
imagePullSecretswas defined in the schema as an array of strings, but Kubernetes requires[]LocalObjectReference(objects with anamefield)--skip-schema-validationglobal.imagePullSecrets,graylog.image.imagePullSecrets, anddatanode.image.imagePullSecretsCloses #84
Usage after fix
Reviewer validation steps
1. Confirm correct format passes schema validation:
2. Confirm plain string format is now rejected:
3. Confirm the pod spec renders correctly:
4. Confirm per-component override also works:
Test plan
imagePullSecrets: [{name: my-pull-secret}]imagePullSecrets: [my-pull-secret](plain string)imagePullSecretsset for both graylog and datanode statefulsets🤖 Generated with Claude Code