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]template BasePath should be the path of template, rather than test.BasePath #1851

Open
1 task done
nkuacac opened this issue Aug 14, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@nkuacac
Copy link

nkuacac commented Aug 14, 2024

chainsaw version Version

v0.2.8

Description

the operation resource file is relate to template, in test will not find the resource file

apiVersion: chainsaw.kyverno.io/v1alpha1
kind: StepTemplate
metadata:
  name: dispatch-workloads
spec:
  try:
    - description: "create curt"
      apply:
        file: (join('/', ['resources', 'customUnitedResourceTemplate.yaml']))
    - description: "assert curt"
      assert:
        file: (join('/', ['resources', 'customUnitedResourceTemplate.yaml']))
    - description: "create cur"
      apply:
        file: (join('/', ['resources', $namespace, 'customUnitedResource.yaml']))
    - description: "assert cur"
      assert:
        file: (join('/', ['resources', $namespace, 'customUnitedResource.yaml']))

Steps to reproduce

  1. create a template like above.
  2. create a test use the template.
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
  name: test
spec:
  - description: "step-5"
    use:
      template: '../../curs/sample/step_init_data_cluster.yaml'

Expected behavior

test in different path can use the template

Screenshots

No response

Logs

No response

Slack discussion

No response

Troubleshooting

  • I have searched other issues in this repository and mine is not recorded.
@nkuacac nkuacac added the bug Something isn't working label Aug 14, 2024
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