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

YAML Anchor support broken between versions 3.8.10 and 3.9.2 #3779

Closed
tomdymond opened this issue Apr 7, 2021 · 4 comments
Closed

YAML Anchor support broken between versions 3.8.10 and 3.9.2 #3779

tomdymond opened this issue Apr 7, 2021 · 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. triage/duplicate Indicates an issue is a duplicate of other open issue.

Comments

@tomdymond
Copy link

Using recent versions of Kustomize it appears YAML anchors have stopped working and render empty dictionaries

---
apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
  name: test
  namespace: test
spec:
  chart:
    version: 0.3.02
 ---
apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
  name: test
  namespace: test
  chart:
    name: test
    version: 0.3.01
  values:
    foo:
      bar:
        ns1: &id001
          foo: bar
          baz: boz

        ns2:
          <<: *id001

---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
patchesStrategicMerge:
  - HelmRelease-patch.yaml

resources:
  - ./HelmRelease.yaml

Using 3.8.10 It renders properly

/usr/local/bin/kustomize-3.8.10 build  .
apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
  chart:
    name: test
    version: 0.3.01
  name: test
  namespace: test
  values:
    foo:
      bar:
        ns1:
          baz: boz
          foo: bar
        ns2:
          baz: boz
          foo: bar
spec:
  chart:
    version: 0.3.02

Using 3.9.2 and onwards (also tested with v4.0.5) it appears to render the anchor as an empty dictionary

/usr/local/bin/kustomize-3.9.2 build  .
apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
  chart:
    name: test
    version: 0.3.01
  name: test
  namespace: test
  values:
    foo:
      bar:
        ns1:
          baz: boz
          foo: bar
        ns2: {}
spec:
  chart:
    version: 0.3.02
@tomdymond tomdymond added the kind/bug Categorizes issue or PR as related to a bug. label Apr 7, 2021
@Shell32-Natsu Shell32-Natsu added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Apr 7, 2021
@rajeshkudaka
Copy link

@tomdymond Anchors work for me in v3.9.2 if --enable_kyaml=false is set in the build command. However, this is still a issue post v4.0.0

@Shell32-Natsu
Copy link
Contributor

Potentially this might be an issue in go-yaml, will confirm.

@KnVerey
Copy link
Contributor

KnVerey commented May 26, 2021

I'm consolidating all the issues related to YAML anchors on this one: #3675. Though they don't all fail with the same error message, they seem to all be related to the switch to kyaml. If you're encountering this issue and YAML anchor support is important to you, please chime in over there.

/close
/triage duplicate

@k8s-ci-robot k8s-ci-robot added the triage/duplicate Indicates an issue is a duplicate of other open issue. label May 26, 2021
@k8s-ci-robot
Copy link
Contributor

@KnVerey: Closing this issue.

In response to this:

I'm consolidating all the issues related to YAML anchors on this one: #3675. Though they don't all fail with the same error message, they seem to all be related to the switch to kyaml. If you're encountering this issue and YAML anchor support is important to you, please chime in over there.

/close
/triage duplicate

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.

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. triage/duplicate Indicates an issue is a duplicate of other open issue.
Projects
None yet
Development

No branches or pull requests

5 participants