-
Notifications
You must be signed in to change notification settings - Fork 699
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
Allow S2I behavior to be overriden by caller #310
Allow S2I behavior to be overriden by caller #310
Conversation
config.Source = sourceURL | ||
} | ||
|
||
b.source = onBuildSourceHandler{ |
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.
this is dupe of line 61
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.
Not sure what you mean - if no override is provided, we now create a default downloader and set it. b.source is only set once.
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.
Ah, you meant 61 in the old file. Fixed.
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.
i liked the old line 61 better than your new one. :)
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.
Fixed it for you - including saving you from a govet error for anonymous
field declarations
On Mon, Oct 19, 2015 at 5:48 PM, Ben Parees [email protected]
wrote:
In pkg/build/strategies/onbuild/onbuild.go
#310 (comment)
:s.SetScripts([]string{}, []string{api.Assemble, api.Run})
- downloader, sourceUrl, err := scm.DownloaderForSource(config.Source)
- if err != nil {
return nil, err
- downloader := overrides.Downloader
- if downloader == nil {
d, sourceURL, err := scm.DownloaderForSource(config.Source)
if err != nil {
return nil, err
}
downloader = d
config.Source = sourceURL
- }
- b.source = onBuildSourceHandler{
i liked the old line 61 better than your new one. :)
—
Reply to this email directly or view it on GitHub
https://github.com/openshift/source-to-image/pull/310/files#r42430517.
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.
thanks, now yours is better :)
One small nit, but I"d like to see tests for that please. |
Assuming this hasn"t changed much since I reviewed it in your origin PR I"m Otherwise it"s going to need to wait until Monday when I have laptop access But +1 to TCs. Ben Parees | OpenShift
|
c0029f6
to
7fdb779
Compare
Why does STI execute take an api.Config that might be different from the api.Config passed to it on creation? |
7fdb779
to
9fa8c8f
Compare
Tests added. |
25df5f4
to
fe5fbf3
Compare
Ok, race averted. |
} | ||
config.Source = sourceUrl | ||
|
||
b.source = onBuildSourceHandler{downloader, s, &ignore.DockerIgnorer{}} |
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.
it is duping this line isn"t it?
c99699a
to
9554076
Compare
squish and lgtm. |
9554076
to
d31d44f
Compare
[merge] On Mon, Oct 19, 2015 at 5:55 PM, Ben Parees [email protected]
|
Origin needs to be able to download and assemble the source itself and then pass it to s2i. This commit adds changes to allow an Overrides object to be passed to the s2i initializer code to provide a custom Downloader. This also makes changes to allow better reuse of upstream s2i code and removes a write to disk for the intermediate tar (which can be streamed instead).
[merge] |
Evaluated for source to image merge up to d31d44f |
Source To Image Merge Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_sti/196/) |
Merged by openshift-bot
Origin needs to be able to download and assemble the source
itself and then pass it to s2i. This commit adds changes to
allow an Overrides object to be passed to the s2i initializer
code to provide a custom Downloader.
This also makes changes to allow better reuse of upstream s2i
code and removes a write to disk for the intermediate tar (which
can be streamed instead).
@mfojtik @bparees review, this is part of binary build