datreeio / datree

Prevent Kubernetes misconfigurations from reaching production (again 😤 )! From code to cloud, Datree provides an E2E policy enforcement solution to run automatic checks for rule violations. See our docs: https://hub.datree.io
https://datree.io
Apache License 2.0
6.39k stars 363 forks source link

Policy check fails but it doesn't reflect in the final summary #79

Closed kaustubhnerurkar closed 3 years ago

kaustubhnerurkar commented 3 years ago

Describe the bug Let's say I have a deployment file and it has replicas field set to blank for whatever reason. Now when 'datree test' is run on this file, it shows a failed policy but final summary shows 'Total rules failed' as 0.

To Reproduce Steps to reproduce the behaviour:

  1. Make a sample Kubernetes Deployment in a yaml and set the 'replicas' field to an empty value
  2. Run 'datree test '
  3. Observe the logs. It says 'Ensure Deployment has more than one replica configured [1 occurrences]' under 'Policy Check' but in the final summary at the bottom, you can see 'Total rules failed' as 0.

Expected behavior 'Total rules failed' should include the count for this failed check.

Screenshots image

Desktop (please complete the following information):

Additional context None

dimabru commented 3 years ago

Hi @kaustubhnerurkar, I'm having trouble reproducing this. Can you please share the yaml file you used to produce this output?

Also, can you please add the version you are using? You can do this by running datree version

Thanks, DIma

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

dimabru commented 3 years ago

We deployed a fix that we believe should solve these types of issues in version 0.1.741. In case the issue persists please feel free to comment on this thread and reopen this issue. Closing it for now.

Thanks, Dima