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

JSON patches not applying with patches, only patchesJson6902 #3084

Closed
stuartpb opened this issue Oct 11, 2020 · 6 comments
Closed

JSON patches not applying with patches, only patchesJson6902 #3084

stuartpb opened this issue Oct 11, 2020 · 6 comments
Assignees

Comments

@stuartpb
Copy link
Contributor

stuartpb commented Oct 11, 2020

See this commit in my system's repository. If I run kustomize build system/local before applying this change, all of the JSON patches are applied; if I switch the patchesJson6902: line to patches:, then several of the patches are not applied. Here's the diff between the two outputs:

25346c25346,25347
<     configInline: {}
---
>     configInline:
>       ingress-status-address: 192.168.42.80
25359a25361
>         st8s.testtrack4.com/zone: "403"
25367c25369,25370
<       service: {}
---
>       service:
>         loadBalancerIP: 192.168.42.80
25433a25437,25447
>     configInline: |
>       address-pools:
>       - name: household-static
>         protocol: layer2
>         addresses:
>         - 192.168.42.0 - 192.168.42.250
>         auto-assign: false
>       - name: household-dynamic
>         protocol: layer2
>         addresses:
>         - 192.168.32.0 - 192.168.32.250
25542a25557,25565
>         storageSpec:
>           volumeClaimTemplate:
>             spec:
>               accessModes:
>               - ReadWriteOnce
>               resources:
>                 requests:
>                   storage: 50Gi
>               storageClassName: throwaway
25670c25693,25694
<   labels: {}
---
>   labels:
>     st8s.testtrack4.com/zone: "403"
25676c25700,25701
<   labels: {}
---
>   labels:
>     st8s.testtrack4.com/zone: "403"
25682c25707,25708
<   labels: {}
---
>   labels:
>     st8s.testtrack4.com/zone: "403"
25688c25714,25716
<   labels: {}
---
>   labels:
>     st8s.testtrack4.com/storage-group: storberry
>     st8s.testtrack4.com/zone: "403"
25694c25722,25724
<   labels: {}
---
>   labels:
>     st8s.testtrack4.com/storage-group: storberry
>     st8s.testtrack4.com/zone: "403"
25700c25730,25733
<   labels: {}
---
>   labels:
>     st8s.testtrack4.com/hats: argon1
>     st8s.testtrack4.com/storage-group: storberry
>     st8s.testtrack4.com/zone: "403"

Kustomize version {Version:3.8.3 GitCommit:$Format:%H$ BuildDate:2020-09-18T18:54:15Z GoOs:linux GoArch:amd64}

This is on Arch Linux.

@Shell32-Natsu
Copy link
Contributor

/assign

@Shell32-Natsu
Copy link
Contributor

Shell32-Natsu commented Oct 12, 2020

You have already had patches in the kustomization.yaml https://github.com/stuartpb/stubernetes/blob/da13816d6099750b7d56e11614495f70f82b1d57/system/local/kustomization.yaml#L95

Remove it will solve the issue.

@Shell32-Natsu
Copy link
Contributor

/close

@k8s-ci-robot
Copy link
Contributor

@Shell32-Natsu: Closing this issue.

In response to this:

/close

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.

@stuartpb
Copy link
Contributor Author

That's weird - shouldn't a YAML file with duplicated keys be rejected by kustomize?

@Shell32-Natsu
Copy link
Contributor

This is the issue in go-yaml v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants