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

[Question] Run test on multiple clusters #2125

Open
pgmgb opened this issue Oct 29, 2024 · 0 comments
Open

[Question] Run test on multiple clusters #2125

pgmgb opened this issue Oct 29, 2024 · 0 comments
Labels
question Further information is requested

Comments

@pgmgb
Copy link

pgmgb commented Oct 29, 2024

Describe your question

Not sure, if I'm going in the wrong direction here - so let me know if there is another way to achieve this :-)

We have two different cluster types (hyperscaler) and our tests need to be executed with also two different permission sets (admin and customer). 

Based on the documentation, I solved the hyperscaler "issue" with labels:

chainsaw test --selector "test-target in (all, h1)"...
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
  name: my-test
  labels:
    test-target: all # all, h1, h2
(...)

The two different permissions would be handled with the cluster configuration.
$KUBECONFIG_PATH will be the same file with one cluster but two different users and contexts.

chainsaw test \
    --cluster customer=$KUBECONFIG_PATH:customer \
    --cluster admin=$KUBECONFIG_PATH:admin \
    --no-cluster
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
  name: my-test
spec:
  cluster: customer
(...)

There is now the use case, that certain tests should be executed in the customer and administrator contexts.
At the moment, I see the only option to duplicate the test and adjusting the cluster: customer to cluster: admin because cluster is a string and not a list.

Are there any suggestions on how to handle this?

chainsaw version Version

v0.2.11

Additional context

No response

@pgmgb pgmgb added the question Further information is requested label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant