Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch file with comments only not supported anymore in 5.2.1 (was supported in 5.1.1) #5487

Open
yogeek opened this issue Dec 13, 2023 · 4 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@yogeek
Copy link

yogeek commented Dec 13, 2023

What happened?

I have multiple patches in a directory, some of them containing only comments (# put here your patches for the foo environment ) to serve as a guidance for end users to know what they could put inside

In kustomize 5.1.1, applying all the patches was not an issue.

Since kustomize 5.2.1, patched files with only comment in it are not supported anymore and kustomize throws an error : illegally qualifies as both an SM and JSON patch

If I remove the comment and leave the file empty, it is working again.

What did you expect to happen?

I expected patches with only comment to be supported as it was in the previous version.
I expected no regression introduced by new version of kustomize.

How can we reproduce it (as minimally and precisely as possible)?

cat <<EOF >> kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
  - appset.yaml

patches:

- target:
    group: argoproj.io
    version: v1alpha1
    kind: ApplicationSet
    name: addons
  path: patches/appset-region-eu.yaml
EOF

mkdir -p patches
cat <<EOF >> patches/appset-region-eu.yaml
# add patches for EU region here if needed
EOF

worked in kustomize 5.1.1 :

$ kustomize build .
<successfully outputs the content of "appset.yaml">

error in kustomize 5.2.1 and above (same result with kustomize 5.3.0) :

$ kustomize build .
Error: trouble configuring builtin PatchTransformer with config: `
path: patches/appset-region-eu.yaml
target:
  group: argoproj.io
  kind: ApplicationSet
  name: gtp-addons
  version: v1alpha1
`: illegally qualifies as both an SM and JSON patch: [path: "patches/appset-region-eu.yaml"]

Expected output

the content of the resource

Actual output

Error: trouble configuring builtin PatchTransformer with config: `
path: patches/appset-region-eu.yaml
target:
  group: argoproj.io
  kind: ApplicationSet
  name: gtp-addons
  version: v1alpha1
`: illegally qualifies as both an SM and JSON patch: [path: "patches/appset-region-eu.yaml"]

Kustomize version

5.2.1

Operating system

Linux

@yogeek yogeek added the kind/bug Categorizes issue or PR as related to a bug. label Dec 13, 2023
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Dec 13, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 12, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 11, 2024
@yogeek
Copy link
Author

yogeek commented Apr 11, 2024

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

3 participants