-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
dockerfile: add lint rule for maintainer instruction #4878
Conversation
98ddfb6
to
3197f85
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check CI errors
@@ -80,6 +80,9 @@ func ParseInstructionWithLinter(node *parser.Node, lintWarn linter.LintWarnFunc) | |||
case command.Env: | |||
return parseEnv(req) | |||
case command.Maintainer: | |||
if lintWarn != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could just have this nil check inside the Run()
one time so every caller does not need to check it.
@@ -41,4 +41,12 @@ var ( | |||
return fmt.Sprintf("Command '%s' should match the case of the command majority (%s)", violatingCommand, correctCasing) | |||
}, | |||
} | |||
RuleMaintainerDeprecated = LinterRule[func() string]{ | |||
Name: "MaintainerDeprecated", | |||
Description: "The maintainer instruction is deprecated and will generate an error in future versions of the Dockerfile syntax", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Because we can't actually remove instructions without v2, maybe "The maintainer instruction is deprecated, use a label instead to define image author."
3197f85
to
d2e2607
Compare
Signed-off-by: Jonathan A. Sternberg <[email protected]>
d2e2607
to
79f66ec
Compare
No description provided.