-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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?
Try the new replacements in structured data feature #5679 added in 5.8.0
Use a replacement where the target uses options for a partial string replacement
What did you expect to happen?
The whole string was replaced inside the structured data (wrong).
A substring was replaced in annotations (correct).
How can we reproduce it (as minimally and precisely as possible)?
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
configMapGenerator:
- name: my-config
options:
disableNameSuffixHash: true
annotations:
example.com/foo: a/b/c
literals:
- |
config.yaml=
foo: a/b/c
replacements:
- sourceValue: zzz
targets:
- select:
kind: ConfigMap
name: my-config
fieldPaths:
- data.config\.yaml.foo
- metadata.annotations.example\.com/foo
options:
delimiter: /
index: 1Expected output
apiVersion: v1
data:
config.yaml: 'foo: a/zzz/c'
kind: ConfigMap
metadata:
annotations:
example.com/foo: a/zzz/c
name: my-configActual output
apiVersion: v1
data:
config.yaml: 'foo: zzz'
kind: ConfigMap
metadata:
annotations:
example.com/foo: a/zzz/c
name: my-configKustomize version
5.8.0
Operating system
Linux
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.