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

allow lower bound version pinning for apk (DL3018) #812

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Hadolint/Rule/DL3018.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dl3018 = simpleRule code severity message check
)
args
check _ = True
versionFixed package = "=" `Text.isInfixOf` package
versionFixed package = "=" `Text.isInfixOf` package || ">=" `Text.isInfixOf` package
packageFile package = ".apk" `Text.isSuffixOf` package
{-# INLINEABLE dl3018 #-}

Expand Down
11 changes: 11 additions & 0 deletions test/Hadolint/Rule/DL3018Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,14 @@ spec = do
it "don't trigger when installing from .apk file" $ do
ruleCatchesNot "DL3018" "RUN apk add mypackage-1.1.1.apk"
onBuildRuleCatchesNot "DL3018" "RUN apk add mypackage-1.1.1.apk"
it "apk add version lower bound (>=) pinned regression" $
let dockerFile =
[ "RUN apk add --no-cache \\",
"flex>=2.6.4-r1 \\",
"libffi>=3.2.1-r3 \\",
"python2>=2.7.13-r1 \\",
"libbz2>=1.0.6-r5"
]
in do
ruleCatchesNot "DL3018" $ Text.unlines dockerFile
onBuildRuleCatchesNot "DL3018" $ Text.unlines dockerFile