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

Add the --target flag as a parameter to the docker builder. #894

Merged
merged 1 commit into from
Aug 22, 2018

Conversation

dlorenc
Copy link
Contributor

@dlorenc dlorenc commented Aug 11, 2018

Fixes #635

@codecov-io
Copy link

codecov-io commented Aug 11, 2018

Codecov Report

Merging #894 into master will increase coverage by 0.14%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #894      +/-   ##
==========================================
+ Coverage   39.38%   39.52%   +0.14%     
==========================================
  Files          61       61              
  Lines        2613     2616       +3     
==========================================
+ Hits         1029     1034       +5     
+ Misses       1471     1469       -2     
  Partials      113      113
Impacted Files Coverage Δ
pkg/skaffold/build/local/docker.go 21.05% <ø> (+2%) ⬆️
pkg/skaffold/docker/image.go 59.18% <100%> (+2.19%) ⬆️

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 47865e3...12bdd06. Read the comment docs.

@dlorenc dlorenc force-pushed the dockertarget branch 2 times, most recently from 32de034 to 7d0f283 Compare August 11, 2018 19:00
@dgageot
Copy link
Contributor

dgageot commented Aug 11, 2018

@dlorenc there’s much more required to support —target. Local builder has two modes, support needs to be added to gcb and kaniko too, and the computation of the build context should also be updated.

@dlorenc
Copy link
Contributor Author

dlorenc commented Aug 11, 2018

Yeah sorry, this needs a WIP tag. I got sidetracked checking to see if kaniko supports the target flag yet.

Can you explain the build context part a little more though? Is that an optimization because some of the build context might not be needed based on the target?

@dlorenc dlorenc added the wip label Aug 11, 2018
@dlorenc
Copy link
Contributor Author

dlorenc commented Aug 11, 2018

@dgageot can you explain what you mean by the local builder having two modes? Are you referring to the docker API vs. docker binary?

@dlorenc
Copy link
Contributor Author

dlorenc commented Aug 22, 2018

ping @dgageot I think I actually did this correctly by accident.

There will be a small change in behavior, but I'm not sure what's correct. Previously if someone specified --cache-from with Kaniko, it would be ignored. Now it'll be an error.

Copy link
Contributor

@dgageot dgageot left a comment

Choose a reason for hiding this comment

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

Minor nit. Other than that, LGTM!

}{
{
name: "build args",
args: args{
Copy link
Contributor

@dgageot dgageot Aug 22, 2018

Choose a reason for hiding this comment

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

WDYT of inlining args? Since it contains a single arguments, I think it makes sense.
Also, most tests use description instead of name to describe the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, this is the pattern the vs-code test generator thing uses by default, but I agree it's overkill

@dgageot
Copy link
Contributor

dgageot commented Aug 22, 2018

@dlorenc you are right that you had it right the first time. I read your PR too quickly. Sorry

@dgageot dgageot removed the wip label Aug 22, 2018
@dlorenc
Copy link
Contributor Author

dlorenc commented Aug 22, 2018

@dlorenc you are right that you had it right the first time. I read your PR too quickly. Sorry

It was definitely by accident :) I didn't realize the GetBuildArgs function was used everywhere, luckily it works.

@dgageot
Copy link
Contributor

dgageot commented Aug 22, 2018

@dlorenc linter is failing

@dlorenc dlorenc merged commit 80b6546 into GoogleContainerTools:master Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants