datree icon indicating copy to clipboard operation
datree copied to clipboard

k8s object names are not displayed during datree kustomize test schema validation

Open Mahesh-Gunda-Maersk opened this issue 2 years ago • 3 comments

Describe the bug is there a way we can get the K8s Object names which are reported during k8s schema validation.

To Reproduce Steps to reproduce the behavior:

  1. using kustomize with lot of crds and yamls.
  2. datree kustomize test Expected behavior k8s object name should be printed in the error message. As we use buch of CRD files and yamls it was quite difficult to find which object has that null value for creationtimestamp

Screenshots image

Desktop (please complete the following information):

Datree version (run datree version): -1.8.21

Additional context
Add any other context about the problem here.
If possible, include a YAML file to reproduce the bug.

Mahesh-Gunda-Maersk avatar Feb 03 '23 09:02 Mahesh-Gunda-Maersk

that's a good point. which metadata do you think can help you debug schema validation errors? will name and kind be enough?

in the meanwhile, as a workaround, you can use the --save-rendered flag. this way, you can open the rendered manifest to understand the root cause of the schema validation error: image

eyarz avatar Feb 05 '23 07:02 eyarz

Thanks. we havily use kustomize with many crds etc. object name/kind will help us lot in identifying the incorrect object. we are not saving rendered output in our CI pipeline. at present we are doing a manual check in the repo.

Mahesh-Gunda-Maersk avatar Feb 06 '23 07:02 Mahesh-Gunda-Maersk

Hello @Mahesh-Gunda-Maersk, I totally agree with your feedback. We're using Kubeconform for validating the K8s schema, and this ability already exists in this package. I'm moving this issue to up for grabs, so someone can raise a PR to support this one. thanks!

adifayer avatar Feb 12 '23 09:02 adifayer