-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Basic support for HTTP URLs in oc start-build --from-file/--from-dir #11811
Conversation
8a8ff80
to
5683e12
Compare
@bparees PTAL. There is only a unit test, I assume higher-level test would be nice to have - end-to-end? extended? integration? cmd? For testing |
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.
instead of overload --from-dir to support "archives", what do you think about introducing a "--from-archive" argument that's used to supply an archive file we expect will be extracted before being used?
then --from-file and --from-dir could both support urls
--from-dir would not support urls, which i think makes more sense because it's weird to use -from-dir with a url since it doesn't actually spider the url or otherwise treat it as a directory of content.
br := bufio.NewReaderSize(resp.Body, 4096) | ||
r = br | ||
if !isArchive(br) { | ||
fmt.Fprintf(out, "WARNING: the provided file may not be an archive (tar, tar.gz, or zip), use --from-file\n") |
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.
is this a warning or an error? it seems weird to report it as a warning but tell them to use a different argument.
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 same warning is printed when you pass regular file to --from-dir
(or pipe non-archive to oc start-build --from-dir -
).
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.
ok
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.
maybe we just need to extend the warning (in all locations) to something like "use --as-file to prevent extraction"
@bparees Agreed that it's non-intuitive. What about making |
I like it except that it would mean --from-dir would still support URLs which is still going to be confusing. I think i can live w/ it as long as it's well documented what the behavior is. |
yeah doing a binary build w/ a file off github would be an option. |
5683e12
to
1808a14
Compare
@bparees updated (still no https test though) |
1808a14
to
b44e05a
Compare
lgtm pending end to end tests. |
b44e05a
to
80609ff
Compare
Updated with tests in |
@@ -55,7 +55,7 @@ | |||
"output": { | |||
"to": { | |||
"kind": "ImageStreamTag", | |||
"name": "origin-ruby-sample:latest" | |||
"name": "ruby-20-centos7-buildcli:latest" |
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.
?
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 original version of the file contained two identical BuildConfigs, ruby-sample-build-validtag
and ruby-sample-build-invalidtag
. There's also ImageStreamTag ruby-20-centos7-buildcli
which is not referenced anywhere.
In order to test binary build with a BuildConfig it has to have correct output specification, otherwise the build pod is not created and the binary input is not sent. Thus this change.
I can create separate fixture for this test if the result is less confusing.
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.
hm. seems like this file is a mess, but the change makes sense for now.
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.
question on why you changed the output imagestreamtag, otherwise lgtm.
lgtm for post 3.4 |
The test that downloads file from github is failing:
This keeps repeating in the log:
The problem is likely caused by me always executing the cmd test directly, not through |
Yep, when running cmd tests there's no node to run pods on. Kinda makes sense for testing just the CLI functionality. I'll move this test to extended tests. |
New option, --from-archive, is an alias for --from-dir. Added because passing archive to --from-dir is counter-intuitive.
80609ff
to
b221c23
Compare
Rebased & moved the the test to test/extended/ [testextended][extended:core(builds)] |
Evaluated for origin testextended up to b221c23 |
lgtm pending passing extended test run. |
continuous-integration/openshift-jenkins/testextended SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin_extended/819/) (Base Commit: 3b2bbe5) (Extended Tests: core(builds)) |
[merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11600/) (Image: devenv-rhel7_5394) |
Evaluated for origin merge up to b221c23 |
[Test]ing while waiting on the merge queue |
Evaluated for origin test up to b221c23 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11600/) (Base Commit: 3b2bbe5) |
Trello card: https://trello.com/c/XxcQN7V5/1070-3-allow-url-to-be-specified-in-oc-start-build-from-file