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

[Bug] YAML anchors are not being rendered when using '<<:' #2298

Open
1 task done
nicolascollet-aldebarancom opened this issue Feb 20, 2025 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@nicolascollet-aldebarancom

chainsaw version Version

v0.2.12

Description

see: #1275 (comment)

the bug still seems to be present in version 0.2.12.

Steps to reproduce

create test with Yaml anchors ...

cd ~ && mkdir -p .chainsaw-test
cat << EOF > .chainsaw-test/chainsaw-test.yaml
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
  name: &name yaml-anchors
spec:
  namespace: &namespace default
  steps:
  - name: *name
    try:
    - apply:
        resource: &resource
          apiVersion: v1
          kind: Pod
          metadata:
            name: *name
            namespace: *namespace
          spec:
            containers:
            - name: main
              image: alpine
    - assert:
        resource:
          <<: *resource
          spec:
            restartPolicy: Always
        timeout: 1s
EOF

start test

chainsaw test --namespace chainsaw   
Version: 0.2.12
Loading default configuration...
- Using test file: chainsaw-test
- TestDirs [.]
- SkipDelete false
- FailFast false
- Namespace 'chainsaw'
- FullName false
- IncludeTestRegex ''
- ExcludeTestRegex ''
- ApplyTimeout 5s
- AssertTimeout 30s
- CleanupTimeout 30s
- DeleteTimeout 15s
- ErrorTimeout 30s
- ExecTimeout 5s
- DeletionPropagationPolicy Background
- Template true
- NoCluster false
- PauseOnFailure false
Loading tests...
Error: failed to parse document (yaml: unmarshal errors:
  line 26: key "spec" already set in map)

version

chainsaw version                  
Version: 0.2.12
Time: 2024-12-04T13:06:58Z
Git commit ID: 6459cd84a78f13d842e0ff0ad2f6a76c321fd579

Expected behavior

chainsaw test --namespace chainsaw
Version: 0.2.12
Loading default configuration...
- Using test file: chainsaw-test
- TestDirs [.]
- SkipDelete false
- FailFast false
- Namespace 'chainsaw'
- FullName false
- IncludeTestRegex ''
- ExcludeTestRegex ''
- ApplyTimeout 5s
- AssertTimeout 30s
- CleanupTimeout 30s
- DeleteTimeout 15s
- ErrorTimeout 30s
- ExecTimeout 5s
- DeletionPropagationPolicy Background
- Template true
- NoCluster false
- PauseOnFailure false
Loading tests...
Running tests...
=== RUN   chainsaw

Screenshots

No response

Logs

Slack discussion

No response

Troubleshooting

  • I have searched other issues in this repository and mine is not recorded.
@nicolascollet-aldebarancom nicolascollet-aldebarancom added the bug Something isn't working label Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant