-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Remove PreBuiltImageBuilder
and make it a function instead.
#1986
Remove PreBuiltImageBuilder
and make it a function instead.
#1986
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov Report
@@ Coverage Diff @@
## master #1986 +/- ##
==========================================
- Coverage 55.48% 55.32% -0.17%
==========================================
Files 173 173
Lines 7510 7505 -5
==========================================
- Hits 4167 4152 -15
- Misses 2952 2961 +9
- Partials 391 392 +1
Continue to review full report at Codecov.
|
88590c6
to
be6c8f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea behind curent implementation is to remove as many branches as possible in the Runner's functions. Too many branches make it too hard to maintain. I'd like to see the bug fixed without removing the PreBuiltImageBuilder
@dgageot, Keeping |
For GoogleContainerTools#922, i am making changes to `skaffold deploy` to not run `skaffold build`. `--images` flag is only used `deploy` flow. The way it works is when `--images` flag is present, runner creates a `PreBuiltImageBuilder`. All it does is, parses the images and converts them to build.Artifact. If during deploy, an image in the list was also built, then it uses the built image tag vs the tag present on the commmand line flag. In this change, we remove creating a PreBuiltImageBuilder in the runner. (Remember this flag is only available for deploy and hence other command won't get affected) The `--images` will now be converted to build.Artifact in the runner.Deploy flow.
be6c8f6
to
be936d3
Compare
71b52b6
to
20e2afc
Compare
I agree that introducing an if statement and overriding the This conditional branching is implemented currently by the switch statement used in the Build step. Which is - I think one of those "clever" solutions that are a bit of a surprising as
So I think we can do better than the current design in terms of non-surpising, more maintainable code. My suggestion would be to introduce the explicit conditional in the runner above the build step. |
For #922, i am making changes to
skaffold deploy
to not runskaffold build
.--images
flag is only useddeploy
flow.The way it works is when
--images
flag is present, runner creates aPreBuiltImageBuilder
. All it does is, parses the images and convertsthem to build.Artifact. If during deploy, an image in the list was also
built, then it uses the built image tag vs the tag present on the
commmand line flag.
In this change, we remove creating a PreBuiltImageBuilder in the runner.
(Remember this flag is only available for deploy and hence other command
won't get affected)
The
--images
will now be converted to build.Artifact in therunner.Deploy flow.