-
Notifications
You must be signed in to change notification settings - Fork 8
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
Allow defining global dynamic fields rules #30
Comments
Hi @czeslavo I totally agree with you. I'll work on this soon.
I think it is good to place What do you think about it? |
Also in the case of dynamicFields are found in .chartsnap.yaml and individual test values files, we need to merge them or override with one of them. I think merging is better for dynamicFields. it is not so difficult to merge as duplication does not make problems, probably. |
Yeah, that sounds like a good idea. It could be the default behavior while you still could use a CLI argument to override it.
I think that merging two slices should be fine even without deduplicating entries. I understand that if there are two rules for the same Kind and its field, the result will be the same as if there was only one. |
@czeslavo Thank you for your response. I'll work on it soon👍 |
@czeslavo I've published a new release. Please check it out! |
Context
I have a use case in which I would like to test multiple test values files located in a single directory (let's say, named
tests
). For every values file, my Helm chart generates Kubernetes Secrets with dynamically generated data. Secrets are always named the same. Now, to make my tests pass, I need to separately add the sametestSpec.dynamicFields
to every test values file which is redundant. I would like to be able to define globaldynamicFields
-like rules that would be used when generating snapshots for every values file in mytests
directory.Expected behavior
It's possible to set a global dynamic fields configuration that is used for every values file. Dynamic fields configuration is used to replace all dynamically generated content with
###DYNAMIC_FIELD###
constant when the rule matches an object's field.Sample command:
Sample config file (
exclude-secrets-data.yaml
):Alternatively, this could be a config file used by the tool, e.g.
.chartsnap.yaml
in which the global configuration would be defined (I believe there could be more global settings to tune than justdynamicFields
in the future).The text was updated successfully, but these errors were encountered: