-
Notifications
You must be signed in to change notification settings - Fork 4.7k
bug 1470374 - oc new-app behaviour #17457
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
bug 1470374 - oc new-app behaviour #17457
Conversation
test adding is pending as I can see strange behavior in failing tests due |
76b4a2d
to
80d655b
Compare
Hi @mjudeikis I think this PR is on the wrong track. Currently on master:
Adding the docker image resolver to the -i | --image-stream option doesn't make sense to me. To resolve bz1470374 I'd expect:
|
Update: read the same comment with a fresh head. to resolve - checking. |
Both use-cases are calling git. even if you pass git url OR local cloned repo, it calls remote git. Question: $ oc new-app openshift/ruby-20-centos7:latest~/home/user/code/my-ruby-app
cmd/newapp.go:
to:
|
80d655b
to
3e76562
Compare
4ccceea
to
0ee20bd
Compare
It shouldn't be calling remote git if you have told it what image to build with. That's the crux of the bug. And @jim-minter indicated that indeed it is not calling git in that situation (See his scenario 1): If you provide an explicit builder image, we should not need to clone your repo because we don't need to attempt to identify what the application type is. (We might attempt to clone it anyway just to see if credentials are required to access your repo, however that should result in a warning, not a failure, if we are unsuccessful).
remote git, assuming the dir has a valid git remote. We should always prefer creating a buildconfig with a git reference over creating a binary build. |
But if we say "check for auth is important" we cant eliminate usage of git command it this case as we still need git to do that... Looks like "its a feature, not a bug" case... I would like to keep "auth checking", but as discussed with @jim-minter, we might want to reconfirm what kind of behavior we expect from these commands. Question is - is it worth it.. |
inability to check for auth should be a warning. in ability to git clone your repo is an error. thus we should only attempt to git clone your repo if we need to. and the root of the bug is that we are git cloning your repo in cases where we do not need to (because we already know what builder image will be used with it). |
UPDATED: Updated 2: moved to PR description |
0ee20bd
to
5593270
Compare
@bparees ping |
@mjudeikis i think my request for tests still needs to be addressed, otherwise lgtm. |
719d635
to
e10fd34
Compare
/lgtm thank you for your perseverance @mjudeikis |
e10fd34
to
a0fd67f
Compare
@bparees you fast :D too fast (one more test added :/ sorry :D ) |
/lgtm |
a0fd67f
to
4113dc5
Compare
/test extended_conformance_gce |
/lgtm |
@mjudeikis: you cannot LGTM your own PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bparees, mjudeikis The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/retest Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue (batch tested with PRs 17539, 17457). |
@mjudeikis: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
oc new-app
oc import-image openshift/ruby-20-centos7:latest --confirm -n openshift
Syntax 1. Case 1. Git: True. URL: Remote.
RESULT: All components created. Source build type.
EXPECTATION: OK
oc new-app openshift/ruby-20-centos7:latest~https://github.com/openshift/ruby-hello-world.git
Syntax 1. Case 2. Git: False. URL: Remote.
RESULT: All components created. Source build type.
EXPECTATION: OK
oc new-app openshift/ruby-20-centos7:latest~https://github.com/openshift/ruby-hello-world.git
Syntax 1. Case 3. GIT: False. URL: HostPath.
RESULT: All components created. BINARY build type.
EXPECTATION: ok
oc new-app openshift/ruby-20-centos7:latest~/root/app-examples/ruby
Syntax 1. Case 4. Git: True. URL: HostDir.
RESULT: (?TBC?)
EXPECTATION: Check if hostDir is valid git - Source. Else - Binary.
oc new-app openshift/ruby-20-centos7:latest~/root/app-examples/ruby
Syntax 2. Case 1. GIT: True. URL: Remote.
RESULT: All components created. Source build type.
EXPECTATION: OK
oc new-app -i ruby-20-centos7:latest https://github.com/openshift/ruby-hello-world.git
Syntax 2. Case 2. GIT: False. URL: Remote
RESULT: No components created. We cant investigate remote repo.
EXPECTATION: Create all components same as
Syntax 1. Case 2
oc new-app -i ruby-20-centos7:latest https://github.com/openshift/ruby-hello-world.git
Syntax 2. Case 3. GIT: False. URL: HostPath.
RESULT: All components created. BINARY build type.
EXPECTATION: ok
oc new-app -i ruby-20-centos7:latest /root/app-examples/ruby
Syntax 2. Case 4. GIT: True. URL: HostPath.
RESULT: (?TBC?)
EXPECTATION: Check if hostDir is valid git - Source. Else - Binary.
oc new-app -i ruby-20-centos7:latest /root/app-examples/ruby
Sytnax 3. Case 1. GIT: True. URL: Remote.
RESULT: All components created. Source build type.
EXPECTATION: ok
oc new-app -i ruby-20-centos7:latest --code https://github.com/openshift/ruby-hello-world.git
Sytnax 3. Case 2. GIT: False. URL: Remote.
RESULT: All components created. Source build type.
EXPECTATION: ok
oc new-app -i ruby-20-centos7:latest --code https://github.com/openshift/ruby-hello-world.git
Sytnax 3. Case 3. GIT: False. URL: HostPath.
RESULT: All components created. Binary build type.
EXPECTATION: ok
oc new-app -i ruby-20-centos7:latest --code /root/app-examples/ruby
Sytnax 3. Case 4. GIT: True. URL: HostPath.
RESULT: (?TBC?)
EXPECTATION: If hostDir - git repo - Source build. Else Binary build.
oc new-app -i ruby-20-centos7:latest --code /root/app-examples/ruby
TODO:
https://bugzilla.redhat.com/show_bug.cgi?id=1470374