-
Couldn't load subscription status.
- 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?
Trying to patch a strategic merge that's inlined in the Kustomization triggers an unable to parse SM or JSON error with no further details.
What did you expect to happen?
The error would explain why the patch failed to merge.
How can we reproduce it (as minimally and precisely as possible)?
# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- configmap.yaml
patches:
- target:
kind: ConfigMap
name: test
patch: |-
data:
foo: quuxapiVersion: v1
kind: Config
metadata:
name: test
data:
foo: barExpected output
$: kustomize build .
Error: trouble configuring builtin PatchTransformer with config: `
patch: |-
data:
foo: quux
target:
kind: ConfigMap
name: test
`: unable to parse SM or JSON patch from [patch: "data:\n foo: quux"]; SM error: missing Resource metadata, JSON6902 error: json: cannot unmarshal object into Go value of type jsonpatch.PatchActual output
$: kustomize build .
Error: trouble configuring builtin PatchTransformer with config: `
patch: |-
data:
foo: quux
target:
kind: ConfigMap
name: test
`: unable to parse SM or JSON patch from [patch: "data:\n foo: quux"]Kustomize version
v5.7.1-41-g88d593f22-dirty
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.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.