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

kustomize failes to merge yaml anchor #4144

Closed
nbraun-wolf opened this issue Aug 25, 2021 · 4 comments
Closed

kustomize failes to merge yaml anchor #4144

nbraun-wolf opened this issue Aug 25, 2021 · 4 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/duplicate Indicates an issue is a duplicate of other open issue.

Comments

@nbraun-wolf
Copy link

Hi, am trying to merge a yaml anchor but kustomize is throwing errors. It works with kubectl apply.

Files that can reproduce the issue

deploy.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: anchor-test
spec:
  selector:
    matchLabels:
      app: anchor-test
  template:
    metadata:
      labels:
        app: anchor-test
    spec:
containers:
- &foo
  name: foo
  image: traefik/whoami
  ports: [ containerPort: 80 ]
  command: [sleep, infinity]
- <<: *foo
  name: bar

kustomization.yaml

resources:
  - "deploy.yaml"

Expected output

apiVersion: apps/v1
kind: Deployment
metadata:
  name: anchor-test
spec:
  selector:
    matchLabels:
      app: anchor-test
  template:
    metadata:
      labels:
        app: anchor-test
    spec:
      containers:
        - command:
            - sleep
            - infinity
          image: traefik/whoami
          name: foo
          ports:
            - containerPort: 80
        - command:
            - sleep
            - infinity
          image: traefik/whoami
          name: bar
          ports:
            - containerPort: 80

Actual output

Error: map[string]interface {}{"apiVersion":"apps/v1", "containers":[]interface {}{map[string]interface {}{"command":[]interface {}{"sleep", "infinity"}, "image":"traefik/whoami", "name":"foo", "ports":[]interface {}{map[string]interface {}{"containerPort":80}}}, map[interface {}]interface {}{"command":[]interface {}{"sleep", "infinity"}, "image":"traefik/whoami", "name":"bar", "ports":[]interface {}{map[string]interface {}{"containerPort":80}}}}, "kind":"Deployment", "metadata":map[string]interface {}{"name":"anchor-test"}, "spec":map[string]interface {}{"selector":map[string]interface {}{"matchLabels":map[string]interface {}{"app":"anchor-test"}}, "template":map[string]interface {}{"metadata":map[string]interface {}{"labels":map[string]interface {}{"app":"anchor-test"}}, "spec":interface {}(nil)}}}: 
json: unsupported type: map[interface {}]interface {}

Kustomize version

$ kustomize version
{Version:unknown GitCommit:$Format:%H$ BuildDate:1970-01-01T00:00:00Z GoOs:linux GoArch:amd64}

Platform

WSL2 Ubuntu20.4

@nbraun-wolf nbraun-wolf added the kind/bug Categorizes issue or PR as related to a bug. label Aug 25, 2021
@k8s-ci-robot
Copy link
Contributor

@nbraun-wolf: 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-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Aug 25, 2021
@KnVerey
Copy link
Contributor

KnVerey commented Sep 1, 2021

Duplicate of #3675
/kind duplicate
/close

@k8s-ci-robot
Copy link
Contributor

@KnVerey: The label(s) kind/duplicate cannot be applied, because the repository doesn't have them.

In response to this:

Duplicate of #3675
/kind duplicate
/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.

@k8s-ci-robot
Copy link
Contributor

@KnVerey: Closing this issue.

In response to this:

Duplicate of #3675
/kind duplicate
/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.

@KnVerey KnVerey added triage/duplicate Indicates an issue is a duplicate of other open issue. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 1, 2021
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. triage/duplicate Indicates an issue is a duplicate of other open issue.
Projects
None yet
Development

No branches or pull requests

3 participants