Skip to content

(helm/v1-alpha) --force flag does not update values.yaml when kustomize manager spec has changed #4625

Open
@abhijith-darshan

Description

@abhijith-darshan

What broke? What's expected?

When scaffolding the project with --plugins=helm.kubebuilder.io/v1-alpha any changes made to manager spec is not copied over to values.yaml when executing kubebuilder edit --plugins=helm/v1-alpha --force

Reproducing this issue

create a new project

$ kubebuilder init --domain my.domain --repo my.domain/guestbook --plugins=go/v4,helm.kubebuilder.io/v1-alpha

The scaffold generates a dist/chart

Next edit the spec of manager.yaml in config/manager/manager.yaml

for example increase the replica count to 2

apiVersion: apps/v1
kind: Deployment
metadata:
  name: controller-manager
  namespace: system
  labels:
    control-plane: controller-manager
    app.kubernetes.io/managed-by: kustomize
spec:
  selector:
    matchLabels:
      control-plane: controller-manager

  replicas: 2
....

run kubebuilder edit --plugins=helm/v1-alpha --force as recommended in the documentation update helm chart wit latest changes

$ kubebuilder edit --plugins=helm/v1-alpha --force
INFO Generating Helm Chart to distribute project  
INFO webhook manifests were not found at config/webhook/manifests.yaml 
INFO Successfully copied config/rbac/leader_election_role.yaml to dist/chart/templates/rbac/leader_election_role.yaml 
INFO Successfully copied config/rbac/leader_election_role_binding.yaml to dist/chart/templates/rbac/leader_election_role_binding.yaml 
INFO Successfully copied config/rbac/metrics_auth_role.yaml to dist/chart/templates/rbac/metrics_auth_role.yaml 
INFO Successfully copied config/rbac/metrics_auth_role_binding.yaml to dist/chart/templates/rbac/metrics_auth_role_binding.yaml 
INFO Successfully copied config/rbac/metrics_reader_role.yaml to dist/chart/templates/rbac/metrics_reader_role.yaml 
INFO Successfully copied config/rbac/role.yaml to dist/chart/templates/rbac/role.yaml 
INFO Successfully copied config/rbac/role_binding.yaml to dist/chart/templates/rbac/role_binding.yaml 
INFO Successfully copied config/rbac/service_account.yaml to dist/chart/templates/rbac/service_account.yaml 
INFO Successfully copied config/network-policy/allow-metrics-traffic.yaml to dist/chart/templates/network-policy/allow-metrics-traffic.yaml

check values.yaml in dist/chart/values.yaml the replica value is still 1

KubeBuilder (CLI) Version

4.5.1

PROJECT version

3

Plugin versions

layout:
- go.kubebuilder.io/v4
- helm.kubebuilder.io/v1-alpha

Other versions

go version 
go1.24.1 darwin/arm64
require (
        ....
	k8s.io/apimachinery v0.32.1
	k8s.io/client-go v0.32.1
	sigs.k8s.io/controller-runtime v0.20.2
)
kubectl version
Client Version: v1.32.1
Kustomize Version: v5.5.0
Server Version: v1.32.0

Extra Labels

No response

Metadata

Metadata

Labels

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

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions