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

Partial string matching on resource values? #506

Open
diranged opened this issue Feb 17, 2024 · 2 comments
Open

Partial string matching on resource values? #506

diranged opened this issue Feb 17, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@diranged
Copy link

What would you like to be added:
I found it pretty surprising that I couldn't do partial string matching (regex or wildcard) on the values in created resources.

Why is this needed:
When working with custom resources like XRDs in Crossplane, I find it difficult to validate certain kinds of dynamic resources because they fundamentally change the return values.. for example, verifying that my Role resource has a status.roleArn field that matches arn:aws:iam:.... The role ARN changes on every test, but fundamentally my goal is to verify that a value was put in there and that it's not empty.

@porridge
Copy link
Member

See also #224 and #70

The closest thing possible right now is to use a TestAssert with a command that does some kind of templating/substitution (if the value you're looking for is predictable at all) and runs a nested kuttl assert.

#387 might make this easier but there are no plans to support regexes. You might want to take a look at https://github.com/kyverno/chainsaw

@eddycharly
Copy link
Contributor

eddycharly commented Feb 19, 2024

Thanks @porridge for the mention!

https://github.com/kyverno/chainsaw supports wildcard matching (and regexes too).

@porridge porridge added the enhancement New feature or request label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants