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

Implement required artifact resolution in buildpacks builder #4962

Merged
merged 2 commits into from
Oct 31, 2020

Conversation

gsquared94
Copy link
Contributor

Related: #4713, #4922

Description (Part 4 of several PRs.)

This PR implements resolving required artifacts as either the builder image or the run image in buildpacks builder as described in the design for supporting dependencies between build artifacts.

@gsquared94 gsquared94 requested a review from a team as a code owner October 28, 2020 19:02
@google-cla google-cla bot added the cla: yes label Oct 28, 2020
@codecov
Copy link

codecov bot commented Oct 28, 2020

Codecov Report

Merging #4962 into master will decrease coverage by 0.05%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4962      +/-   ##
==========================================
- Coverage   72.34%   72.29%   -0.06%     
==========================================
  Files         360      361       +1     
  Lines       12564    12665     +101     
==========================================
+ Hits         9090     9156      +66     
- Misses       2808     2829      +21     
- Partials      666      680      +14     
Impacted Files Coverage Δ
pkg/skaffold/build/local/local.go 60.41% <0.00%> (ø)
pkg/skaffold/build/buildpacks/lifecycle.go 81.72% <85.71%> (+0.56%) ⬆️
pkg/skaffold/build/buildpacks/types.go 100.00% <100.00%> (ø)
pkg/skaffold/deploy/kpt/kpt.go 73.92% <0.00%> (-5.59%) ⬇️
pkg/skaffold/deploy/helm/helm.go 74.11% <0.00%> (-0.51%) ⬇️
pkg/skaffold/util/http.go 50.00% <0.00%> (ø)
pkg/skaffold/util/util.go 83.33% <0.00%> (+0.93%) ⬆️
pkg/skaffold/update/update.go 45.45% <0.00%> (+6.99%) ⬆️

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 d667827...07ce148. Read the comment docs.

Copy link
Contributor

@MarlonGamez MarlonGamez left a comment

Choose a reason for hiding this comment

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

Looks good :) just have a couple nits/q's

Comment on lines +174 to +187
if builderImage == d.Alias {
builderImage, found = r.GetImageTag(d.ImageName)
if !found {
logrus.Fatalf("failed to resolve build result for required artifact %q", d.ImageName)
}
builderImageLocal = true
}
if runImage == d.Alias {
runImage, found = r.GetImageTag(d.ImageName)
if !found {
logrus.Fatalf("failed to resolve build result for required artifact %q", d.ImageName)
}
runImageLocal = true
}
Copy link
Contributor

Choose a reason for hiding this comment

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

can these two code paths be combined into one? And then do the check at the end to either set builderImageLocal = true or runImageLocal = true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not quite sure how though, can you suggest the code change you're thinking?

Copy link
Contributor

Choose a reason for hiding this comment

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

On second look, maybe they can't, my bad 😅

Do you think the log messages should be differentiated to say either builder image or run image? Or do you think the user will have enough info from the ImageName?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is actually an impossible scenario. It'll only happen if we ever introduce a bug into the code.

Copy link
Contributor

@MarlonGamez MarlonGamez left a comment

Choose a reason for hiding this comment

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

Looks good 👍🏼 thanks for addressing the readability change :)

@gsquared94 gsquared94 merged commit efe6601 into GoogleContainerTools:master Oct 31, 2020
@gsquared94 gsquared94 added this to the v1.17.0 milestone Nov 6, 2020
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.

2 participants