-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed as not planned
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.Denotes an issue or PR that has aged beyond stale and will be auto-closed.triage/needs-informationIndicates an issue needs more information in order to work on it.Indicates an issue needs more information in order to work on it.
Description
What happened?
I am trying to use kustomize to rewrite ConfiMap names to include a hash suffix.
Ideally the suffix is based on the content of the ConfigMap.
What did you expect to happen?
Since I am merging an existing ConfigMap with an empty one from the generator, I would have expected for the content hash of the final content to be added as a suffix.
How can we reproduce it (as minimally and precisely as possible)?
# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- caddy.yaml
generatorOptions:
disableNameSuffixHash: false
configMapGenerator:
- name: caddy
namespace: infra
behavior: merge# caddy.yaml
---
apiVersion: v1
kind: ConfigMap
metadata:
namespace: infra
name: caddy
labels:
app: caddy
data:
Caddyfile: |
{
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: infra
name: caddy
labels:
app: caddy
spec:
replicas: 1
selector:
matchLabels:
app: caddy
template:
metadata:
labels:
app: caddy
spec:
containers:
- name: caddy
image: caddy:2.7.6-alpine
volumes:
- name: caddy-config
configMap:
name: caddyExpected output
apiVersion: v1
data:
caddy-configmap.yaml: |
apiVersion: v1
kind: ConfigMap
metadata:
namespace: infra
name: caddy
labels:
app: caddy
data:
Caddyfile: |
{
}
kind: ConfigMap
metadata:
labels:
app: caddy
name: caddy-AB1234
namespace: infra
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: caddy
name: caddy
namespace: infra
spec:
replicas: 1
selector:
matchLabels:
app: caddy
template:
metadata:
labels:
app: caddy
spec:
containers:
- image: caddy:2.7.6-alpine
name: caddy
volumes:
- configMap:
name: caddy-AB1234
name: caddy-configActual output
apiVersion: v1
data:
Caddyfile: |
{
}
kind: ConfigMap
metadata:
labels:
app: caddy
name: caddy
namespace: infra
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: caddy
name: caddy
namespace: infra
spec:
replicas: 1
selector:
matchLabels:
app: caddy
template:
metadata:
labels:
app: caddy
spec:
containers:
- image: caddy:2.7.6-alpine
name: caddy
volumes:
- configMap:
name: caddy
name: caddy-configKustomize version
v5.4.2
Operating system
MacOS
Metadata
Metadata
Assignees
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.Denotes an issue or PR that has aged beyond stale and will be auto-closed.triage/needs-informationIndicates an issue needs more information in order to work on it.Indicates an issue needs more information in order to work on it.