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

Add debug information to help understand failures finding schemas #133

Merged
merged 2 commits into from
Oct 16, 2022

Conversation

yannh
Copy link
Owner

@yannh yannh commented Oct 15, 2022

When using -schema-location, it is sometimes difficult to understand why kubeconform fails to find the appropriate resource schema. This PR adds a -debug parameter that prints information on where Kubeconform tries to download schemas and which schema it will use for validation.

image

@yannh
Copy link
Owner Author

yannh commented Oct 15, 2022

cc @eyarz I've been wanting this option forever to make it easier to use -schema-location... if there is any additional debug info you think could be useful or any comment on the format now would be a good time :)

@eyarz
Copy link
Contributor

eyarz commented Oct 15, 2022

Awesome! More debug info is always good :)
To be frank, we don't see our users having a lot of issues with this flag.

We added the CRDs-catalog to run with default, so basically, Datree users are running:
kubeconform -schema-location default -schema-location [CRDs-catalog path].
This solved 99% of all the issues that our users had when they tried to use the -schema-location flag to validate CRDs.

The debug info level and the format LGTM 👍
Just to make sure, if not using the deug flag, the error could not find schema for... will still be raised, right?
I'm asking because we have some logic that relies on the error message.

@yannh
Copy link
Owner Author

yannh commented Oct 15, 2022

Yep that won't change, but you won't always see all the different URLs kubeconform tried to download - when writing tests I sometimes have a hard time myself trying to understand the paths computed...
And yes your CRD-catalog is prettty neat I might start to use it soon as well 🚀

@yannh yannh merged commit f68d6ec into master Oct 16, 2022
yannh added a commit that referenced this pull request Oct 16, 2022
* Add debug information to help understand failures finding schemas

* Add debug information to help understand failures finding schemas
yannh added a commit that referenced this pull request Oct 16, 2022
* Add debug information to help understand failures finding schemas

* Add debug information to help understand failures finding schemas
@yannh yannh deleted the debug-mode branch October 16, 2022 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants