datree icon indicating copy to clipboard operation
datree copied to clipboard

--verbose should work with --output

Open hadar-co opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. When using the verbose flag and the output flag in the same policy check, the verbose output is not written. For example, when running:

datree test ~/.datree/k8s-demo.yaml -o json --verbose

The output does not include the "how to fix" links:

{"policyValidationResults":[{"fileName":"/Users/hadarco/.datree/k8s-demo.yaml","ruleResults":[{"identifier":"CONTAINERS_MISSING_IMAGE_VALUE_VERSION","name":"Ensure each container image has a pinned (tag) version","messageOnFailure":"Incorrect value for key `image` - specify an image version to avoid unpleasant \"version surprises\" in the future","occurrencesDetails":[{"metadataName":"rss-site","kind":"Deployment","skipMessage":"","occurrences":1,"isSkipped":false}]},{"identifier":"CONTAINERS_MISSING_MEMORY_LIMIT_KEY","name":"Ensure each container has a configured memory limit","messageOnFailure":"Missing property object `limits.memory` - value should be within the accepted boundaries recommended by the organization","occurrencesDetails":[{"metadataName":"rss-site","kind":"Deployment","skipMessage":"","occurrences":1,"isSkipped":false}]},{"identifier":"WORKLOAD_INVALID_LABELS_VALUE","name":"Ensure workload has valid label values","messageOnFailure":"Incorrect value for key(s) under `labels` - the vales syntax is not valid so the Kubernetes engine will not accept it","occurrencesDetails":[{"metadataName":"rss-site","kind":"Deployment","skipMessage":"","occurrences":1,"isSkipped":false}]},{"identifier":"CONTAINERS_MISSING_LIVENESSPROBE_KEY","name":"Ensure each container has a configured liveness probe","messageOnFailure":"Missing property object `livenessProbe` - add a properly configured livenessProbe to catch possible deadlocks","occurrencesDetails":[{"metadataName":"rss-site","kind":"Deployment","skipMessage":"","occurrences":1,"isSkipped":false}]}]}],"policySummary":{"policyName":"Default","totalRulesInPolicy":23,"totalSkippedRules":0,"totalRulesFailed":4,"totalPassedCount":19},"evaluationSummary":{"configsCount":1,"filesCount":1,"passedYamlValidationCount":1,"k8sValidation":"1/1","passedPolicyValidationCount":0},"yamlValidationResults":null,"k8sValidationResults":null}

Describe the solution you'd like the verbose flag should work with all output formats.

hadar-co avatar Aug 07 '22 10:08 hadar-co