google / google/yamlfmt

kyaml: yaml anchors get replaced

Open
#308 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.8k
Forks
75
PR merge metrics
No merged PRs in 30d

Description

yaml x-anchors are being deleted and inline values replaced.
the whole point of having the anchors is to make it easy to know what values require changing.

```yaml
x-anchors:
environment: &environment "alpha"
internalDnsName: &internalDnsName "test-app.example.com"
serviceAccountName: &serviceAccountName svcacct
argo:
clustersgroup:
- alpha

deployment:
environment: *environment
serviceName: test-application
serviceAccount:
create: false
name: *serviceAccountName
```

```yaml
#kyaml
---
{
x-anchors: {
environment: "alpha",
internalDnsName: "test-app.example.com",
serviceAccountName: "svcacct",
},
argo: {
clustersgroup: [
"alpha",
],
},
deployment: {
environment: "alpha",
serviceName: "test-application",
serviceAccount: {
create: false,
name: "svcacct",
},
[...]
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.