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

fix: skaffold's assumption for image tag when building via buildkit and custom output #7120

Merged
merged 1 commit into from
Feb 16, 2022

Conversation

elnoro
Copy link
Contributor

@elnoro elnoro commented Feb 16, 2022

Fixes: #7024

Description
The original issue is about using local docker buildkit build. When building with buildkit and custom output, image is not tagged by default. Empty image id is passed to ImageAPIClient.ImageTag from the docker package, which fails.

This line suggests that an empty image id is a valid use case in some circumstances.

I simply added a new condition to the method - if image id is empty, docker ImageTag is not called and simply returns empty string instead.
Unit test included.

User facing changes (remove if N/A)
Before
When using buildkit and custom output, skaffold returned the following error
Error parsing reference: "" is not a valid repository/tag: invalid reference format
After
When using buildkit and custom output, skaffold successfully completes build.

Custom output is produced in both cases, as it's exported by the docker cli, not by skaffold

@elnoro elnoro requested a review from a team as a code owner February 16, 2022 19:46
@elnoro elnoro requested a review from gsquared94 February 16, 2022 19:46
@tejal29
Copy link
Contributor

tejal29 commented Feb 16, 2022

Thanks @elnoro for your PR.

will try the steps mentioned in the original issue to verify.

Can you please fix the commit message to be in accordance conventionalcommits.org by using git commit --amend

@codecov
Copy link

codecov bot commented Feb 16, 2022

Codecov Report

Merging #7120 (e713c4e) into main (290280e) will decrease coverage by 1.81%.
The diff coverage is 56.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7120      +/-   ##
==========================================
- Coverage   70.48%   68.67%   -1.82%     
==========================================
  Files         515      558      +43     
  Lines       23150    26086    +2936     
==========================================
+ Hits        16317    17914    +1597     
- Misses       5776     6941    +1165     
- Partials     1057     1231     +174     
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 209 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 35ec779...e713c4e. Read the comment docs.

@elnoro
Copy link
Contributor Author

elnoro commented Feb 16, 2022

Hello, commit message has been updated.

I see there is a failing unit test on windows - deploy/kustomize/kustomize_test.go running for more than 1m.
This seems unrelated to the changes, but I'll see if I can find the connection.

@tejal29 tejal29 changed the title fix for #7024 fix: skaffold's assumption for image tag when building via buildkit and custom output Feb 16, 2022
@tejal29
Copy link
Contributor

tejal29 commented Feb 16, 2022

re-running the test suite.

@tejal29 tejal29 merged commit 0aec982 into GoogleContainerTools:main Feb 16, 2022
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.

Skaffold does not cope well with buildkit used with --output (invalid reference format)
2 participants