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

Incorrect rules are skipped without mention, giving the impression all is well #218

Open
fliphess opened this issue Oct 30, 2020 · 1 comment

Comments

@fliphess
Copy link

Hey :) Thanks for writing this utility.

I have some questions regarding missing keys or checks that are suppose to fail but dont.

I have the following yaml:

apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
  name: some-chart
  namespace: default
  annotations:
    fluxcd.io/automated: false

When I on purpose remove a few chars so that the assertion is supposed to fail:

- id: CHECK_HELMRELEASE
  severity: FAILURE
  message: Check validity for helmrelease
  resource: "HelmRelease"
  assertions:
  - key: metadata
    op: has-properties
    value: name,namespace,annotat

.... The check still succeeds.

Is this intended behaviour? It looks like a regex is used or a string in string comparison where the full key should be checked instead.

@fliphess
Copy link
Author

fliphess commented Oct 30, 2020

Apparently I have the same behaviour with several other operators (not-empty, present, in) that return OKAY when there are purposefully created bugs that should fail the check.

Using -verbose shows me the check on itself is faulty and as a result completely ignored, which is not shown when using -validate.

Would it be possible to change this behaviour into a hard fail?

I think it's much safer to bail out when a rule is incorrect rather than skipping it without mention which implies all is well, like when the check succeeds.

@fliphess fliphess changed the title has-properties does not check the full key Incorrect rules are skipped without mention, giving the impression all is well Oct 30, 2020
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

No branches or pull requests

1 participant