Skip to content

Helm plugin v2-alpha doesn't template imagePullSecrets #5241

@zarcen

Description

@zarcen

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.

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

  1. Add a sample secret in a kubebuilder project in the kustomization file config/manager/manager.yaml:
+     imagePullSecrets:
+     - name: my-secret
      containers:
      - command:
        - /manager
        args:
  1. Use the helm v2-alpha plugin:
kubebuilder edit --plugins=helm/v2-alpha
  1. Verify the generated helm template at dist/chart/templates/manager/manager.yaml. It doesn't parse the imagePullSecrets for 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: dist

Other versions

No response

Extra Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions