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

dockerfile: only report legacy key/value format when stage is reachable #5001

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

jsternberg
Copy link
Collaborator

This modifies the linter to only report the legacy key/value format if the stage is reachable to be more compatible with the other lints that operate this way.

Instead of reporting the warning in the parser, it records whether a delimiter is present in the KeyValuePair and this gets checked when the dispatch happens.

ENV key value
LABEL key value

FROM a AS c
`)
checkLinterWarnings(t, sb, &lintTestParams{Dockerfile: dockerfile})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this test will not pass after rebase to #5000 and should needs to be rewritten like the test in that PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased and updated.

This modifies the linter to only report the legacy key/value format if
the stage is reachable to be more compatible with the other lints that
operate this way.

Instead of reporting the warning in the parser, it records whether a
delimiter is present in the KeyValuePair and this gets checked when the
dispatch happens.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
@tonistiigi tonistiigi merged commit 49b935f into moby:master Jun 6, 2024
74 checks passed
@jsternberg jsternberg deleted the legacy-env-lint-dispatch-only branch July 10, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants