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

--failure-threshold does not work as expected (exits 0) if set to level: 'error' #651

Closed
1 of 3 tasks
Dentrax opened this issue Jun 3, 2021 · 2 comments · Fixed by #653
Closed
1 of 3 tasks

--failure-threshold does not work as expected (exits 0) if set to level: 'error' #651

Dentrax opened this issue Jun 3, 2021 · 2 comments · Fixed by #653

Comments

@Dentrax
Copy link

Dentrax commented Jun 3, 2021

  • This is a bug report
  • This is a feature request
  • I searched existing issues before opening this one

Expected behavior

It should exit with 1.

Actual behavior

It exits with 0.

Steps to reproduce the behavior

  1. $ hadolint --failure-threshold error --verbose ./Dockerfile
  2. echo $? # prints 0
No configuration was specified. Using default configuration
./Dockerfile:8 DL3020 error: Use COPY instead of ADD for files and folders
./Dockerfile:10 DL3000 error: Use absolute WORKDIR
./Dockerfile:19 DL3008 warning: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
...

Output of hadolint --version:

Haskell Dockerfile Linter 2.4.1-no-git
@druwadi
Copy link

druwadi commented Jun 7, 2021

I'm having the same issue with this, I changed the trusted registry to create an error, and the error still passed the threshold.

m-ildefons added a commit to m-ildefons/hadolint that referenced this issue Jun 10, 2021
The help message suggests that the failure threshold makes Hadolint exit
with failure when a rule above **or equal to** the threshold is
violated. This was introduced to the help message with
hadolint@3121fe9
But never updated the behaviour to match the help message.

fixes: hadolint#651
@m-ildefons
Copy link
Collaborator

Sorry for the confusion on this. There was a lengthy discussion on whether or not the behavior should be inclusive or exclusive of the threshold itself here and the docs were updated here, but the behavior itself never changed.

lorenzo pushed a commit that referenced this issue Jun 10, 2021
The help message suggests that the failure threshold makes Hadolint exit
with failure when a rule above **or equal to** the threshold is
violated. This was introduced to the help message with
3121fe9
But never updated the behaviour to match the help message.

fixes: #651
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

Successfully merging a pull request may close this issue.

3 participants