Skip to content

Add skip-validation flag; Remove default save path #194

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

Merged
merged 3 commits into from
Apr 18, 2025

Conversation

dhaiducek
Copy link
Contributor

Feature:

  • Adds a --skip-validation flag in order to do things like (you know, just off the top of my head 😂):
    str='{{ toYAML (set (fromYAML (fromConfigMap "default" "example" "file.yml")) "greeting" "hello") }}'
    echo "test: '${str}'" | template-resolver --skip-validation
    echo "test: |
      ${str}" | template-resolver --skip-validation

Fix:

  • Removes the default s from save resources so that resources are not saved by default.

@yiraeChristineKim
Copy link
Contributor

Do we need a unit test like your example

str='{{ toYAML (set (fromYAML (fromConfigMap "default" "example" "file.yml")) "greeting" "hello") }}'
echo "test: '${str}'" | template-resolver --skip-validation
echo "test: |
  ${str}" | template-resolver --skip-validation

@dhaiducek
Copy link
Contributor Author

Do we need a unit test like your example

Yes, we most definitely do 🙂 I think I wasn't 100% sure this PR was desirable. I'll add a test, though!

@JustinKuli
Copy link
Contributor

Does this only skip "validation" around Policy/ConfigurationPolicy details? As in, if I gave it an invalid template that doesn't close a {{ or something, that would still give an error of some kind, right?

If so, I'm wondering if this option should be renamed to "non-policy" or something similar.

@dhaiducek
Copy link
Contributor Author

Does this only skip "validation" around Policy/ConfigurationPolicy details? As in, if I gave it an invalid template that doesn't close a {{ or something, that would still give an error of some kind, right?

If so, I'm wondering if this option should be renamed to "non-policy" or something similar.

That's correct. True, something like --skip-policy-validation?

Copy link

Copy link

openshift-ci bot commented Apr 18, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dhaiducek, JustinKuli

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [JustinKuli,dhaiducek]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit d1c7656 into stolostron:main Apr 18, 2025
6 checks passed
@dhaiducek dhaiducek deleted the skip-validation branch April 18, 2025 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants