datreeio / action-datree

Github action that runs the Datree CLI
MIT License
24 stars 15 forks source link

datree-action fails to test kustomization.yaml files #20

Closed gilbahat closed 1 year ago

gilbahat commented 1 year ago

Hi,

when running datree in kustomize mode, failed builds will generate an empty yaml, causing an uninformative error message.

Therefore, we are trying to test the actual kustomization.yaml files for schema conformance and yaml validity. This works on the CLI, but not on the action:

CLI: ✗ datree test infrastructure/kustomization.yaml

(Summary)

+-----------------------------------+------------------------------------------------------+ | Enabled rules in policy "Default" | 21 | | Configs tested against policy | 1 | | Total rules evaluated | 21 | | Total rules skipped | 0 | | Total rules failed | 0 | | Total rules passed | 21 | | See all rules in policy | REDACTED | +-----------------------------------+------------------------------------------------------+

action:

File: /github/workspace/infrastructure/kustomization.yaml

[V] YAML validation [X] Kubernetes schema validation

❌ k8s schema validation error: could not find schema for Kustomization

Are you trying to test Kustomize files? To run Datree with Kustomize, use datree kustomize test command, or check out Kustomize support docs: https://hub.datree.io/kustomize-support

To troubleshoot: refer to our docs [https://hub.datree.io/troubleshooting#schema-validation-failure] To ignore this failure: use the CLI flag --ignore-missing-schemas

[?] Policy check didn't run for this file

please advise

gilbahat commented 1 year ago

okay, so apparently the empty-file-generated failure mode is highly specific to a kustomization.yaml with a broken schema definition. This is a kustomize error and not a datree action one. closing.