atlantis icon indicating copy to clipboard operation
atlantis copied to clipboard

docs: Add --no-fail to custom policy execution in policy-checking.md

Open ltmleo opened this issue 1 year ago • 3 comments
trafficstars

As mentioned in https://github.com/runatlantis/atlantis/issues/4092 When executing something like

workflows:
  custom:
    policy_check:
      steps:
        - show
        - run: conftest test $SHOWFILE *.tf

The following , not helpful, output are shown:

Policy Check Error unable to unmarshal conftest output

To work properly I needed to add the fields shown below

custom_policy_check: true
workflows:
  custom:
    policy_check:
      steps:
        - show
        - run: conftest test $SHOWFILE *.tf --no-fail

what

Add --no-fail to custom policy execution.

why

As mentioned in https://github.com/runatlantis/atlantis/issues/4092, this expected the --no-fail flag.

tests

Documentation changes

references

https://github.com/runatlantis/atlantis/issues/4092

ltmleo avatar Mar 21 '24 17:03 ltmleo

@ltmleo in the docs I do not see a --no-fail option, maybe you are using an old version of contest?

jamengual avatar Apr 02 '24 19:04 jamengual

@ltmleo in the docs I do not see a --no-fail option, maybe you are using an old version of contest?

Actually, i'm using the latest version:

conftest --version
Conftest: 0.51.0
OPA: 0.63.0

v0.51.0 Latest @github-actions github-actions released this 3 days ago

I also didn't find it in the documentation, I found it in the help, so I think the documentation is out-to-date.

conftest test -h
...
--no-fail                   Return an exit code of zero even if a policy fails
...

ltmleo avatar Apr 03 '24 14:04 ltmleo

@ltmleo in the docs I do not see a --no-fail option, maybe you are using an old version of contest?

Actually, i'm using the latest version:

conftest --version
Conftest: 0.51.0
OPA: 0.63.0

v0.51.0 Latest @github-actions github-actions released this 3 days ago

I also didn't find it in the documentation, I found it in the help, so I think the documentation is out-to-date.

conftest test -h
...
--no-fail                   Return an exit code of zero even if a policy fails
...

I'm a bit apprehensive about adding a suggestion in the docs that only works with the latest version and is not even in the doc site, it could mislead users to use it and might fail for them

jamengual avatar Apr 03 '24 17:04 jamengual

relates to

  • https://github.com/open-policy-agent/conftest/issues/544

chenrui333 avatar May 22 '24 19:05 chenrui333