-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
What broke? What's expected?
In the new helm plugin v2-alpha, it doesn't template and respect kustomize config when it has .spec.imagePullSecrets in manager:
kubebuilder edit --plugins=helm/v2-alpha
# It overwrites the dist/chart/templates/manager/manager.yaml without including `.spec.imagePullSecrets`
The templater misses the processing for imagePullSecret.
kubebuilder/pkg/plugins/optional/helm/v2alpha/scaffolds/internal/kustomize/helm_templater.go
Lines 182 to 187 in c169977
| func (t *HelmTemplater) templateDeploymentFields(yamlContent string) string { | |
| // Template configuration fields | |
| yamlContent = t.templateImageReference(yamlContent) | |
| yamlContent = t.templateEnvironmentVariables(yamlContent) | |
| yamlContent = t.templatePodSecurityContext(yamlContent) | |
| yamlContent = t.templateContainerSecurityContext(yamlContent) |
Expect:
It should generate template like .spec.containers[0].env when it exists from the passed manifest (default: dist/install.yaml
Actual:
The generated dist/chart/templates/manager/manager.yaml file doesn't parse for .spec.imagePullSecrets.
Reproducing this issue
- Add a sample secret in a kubebuilder project in the kustomization file
config/manager/manager.yaml:
+ imagePullSecrets:
+ - name: my-secret
containers:
- command:
- /manager
args:- Use the helm v2-alpha plugin:
kubebuilder edit --plugins=helm/v2-alpha
- Verify the generated helm template at
dist/chart/templates/manager/manager.yaml. It doesn't parse theimagePullSecretsfor the manager deployment.
KubeBuilder (CLI) Version
Version: cmd.version{KubeBuilderVersion:"4.10.1", KubernetesVendor:"1.34.1", GitCommit:"8bce950e46b914d54c872da25500b8c27b6c05e8", BuildDate:"2025-11-16T18:47:21Z", GoOs:"darwin", GoArch:"arm64"}
PROJECT version
3
Plugin versions
layout:
- go.kubebuilder.io/v4
plugins:
helm.kubebuilder.io/v2-alpha:
manifests: dist/install.yaml
output: distOther versions
No response
Extra Labels
No response