-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.
Description
What happened?
Before kustomize 5.8.0 if i declare the namespace in the /namespace of the kustomization.yaml file it will add a namespace to all the resources without an explicit namespace.
After 5.8.0 it won't add the namespace, breaking several 3rd party charts where the resources doesn't have an explicit namespace: {{ .Release.Namespace }} template.
For example i can no longer install the mariadb-operator chart in argocd after the kustomize update because the resources no longer have a namespace.
As a workaround for this specific chart i am using the following:
patches:
- target:
kind: (ConfigMap|ServiceAccount|Deployment|ServiceMonitor|Role|RoleBinding|Service)
patch: |-
- op: add
path: /metadata/namespace
value: mariadb-systemBut this can break anytime the chart or values.yaml is updated.
What did you expect to happen?
The resources must have a namespace like in previous versions.
How can we reproduce it (as minimally and precisely as possible)?
# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: mariadb-system
helmCharts:
- name: mariadb-operator
repo: https://helm.mariadb.com/mariadb-operator
version: 25.10.4
releaseName: mariadb-operator
namespace: mariadb-systemExpected output
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/instance: mariadb-operator
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: mariadb-operator
app.kubernetes.io/version: 25.10.4
helm.sh/chart: mariadb-operator-25.10.4
name: mariadb-operator
namespace: mariadb-system
spec:
...Actual output
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/instance: mariadb-operator
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: mariadb-operator
app.kubernetes.io/version: 25.10.4
helm.sh/chart: mariadb-operator-25.10.4
name: mariadb-operator
spec:
...Kustomize version
5.8.0
Operating system
Linux
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.