Skip to content

fix: allow quotes on base image tags in Dockerfiles #7027

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

Merged
merged 1 commit into from
Jan 20, 2022

Conversation

nkubala
Copy link
Contributor

@nkubala nkubala commented Jan 19, 2022

Fixes: #7026

Description

Previously, our logic to remove quotes on base images just removed leading/trailing quotes, which was fine for strings like FROM "scratch" but failed with strings like FROM golang:"1.15", which is a valid image reference. This change uses strings.ReplaceAll instead of strings.TrimFunc which should fix this issue.

@nkubala nkubala requested a review from a team as a code owner January 19, 2022 19:45
@nkubala nkubala requested a review from aaron-prindle January 19, 2022 19:45
@codecov
Copy link

codecov bot commented Jan 19, 2022

Codecov Report

Merging #7027 (295babe) into main (290280e) will decrease coverage by 1.66%.
The diff coverage is 56.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7027      +/-   ##
==========================================
- Coverage   70.48%   68.82%   -1.67%     
==========================================
  Files         515      554      +39     
  Lines       23150    25751    +2601     
==========================================
+ Hits        16317    17722    +1405     
- Misses       5776     6826    +1050     
- Partials     1057     1203     +146     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/deploy.go 52.00% <ø> (-1.85%) ⬇️
cmd/skaffold/app/cmd/dev.go 84.61% <0.00%> (ø)
cmd/skaffold/app/cmd/render.go 36.66% <0.00%> (-4.72%) ⬇️
cmd/skaffold/skaffold.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/inspect_tests.go 62.50% <14.28%> (-1.14%) ⬇️
cmd/skaffold/app/cmd/lsp.go 28.12% <28.12%> (ø)
cmd/skaffold/app/cmd/fix.go 68.85% <40.00%> (-7.62%) ⬇️
cmd/skaffold/app/cmd/lint.go 42.85% <42.85%> (ø)
cmd/skaffold/app/cmd/find_configs.go 48.88% <50.00%> (+0.24%) ⬆️
cmd/skaffold/app/skaffold.go 76.19% <70.00%> (-8.43%) ⬇️
... and 182 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a045287...295babe. Read the comment docs.

Copy link
Contributor

@aaron-prindle aaron-prindle left a comment

Choose a reason for hiding this comment

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

LGTM

@MarlonGamez MarlonGamez merged commit 60b81b5 into GoogleContainerTools:main Jan 20, 2022
@nkubala nkubala deleted the parse-quotes-on-tags branch January 20, 2022 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dockerfiles with quotes on base image tags fail to parse
3 participants