Bug 1357674
Summary: | oc does not validate that git is installed. | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | jritenou |
Component: | Build | Assignee: | Cesar Wong <cewong> |
Status: | CLOSED ERRATA | QA Contact: | Wang Haoran <haowang> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 3.2.0 | CC: | aos-bugs, bparees, dyan, jokerman, mmccomas, tdawson, xtian, xxia |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-09-27 09:40:47 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
jritenou
2016-07-18 20:17:02 UTC
Discussed w/ Cesar.. in the case that you are trying to new-app (or new-build) from a git repo and we couldn't find git, we will tell you explicitly that we could not find git and you need to either: 1) install git (or get it into your path) 2) specify --binary to do setup a binary build (which does not require git) This will involve adding the --binary flag to new-app, as it currently only exists on new-build. Both new-app and new-build currently have a behavior defined when pointed to a directory that is not a git repository or does not have an origin remote defined. They fall back to creating a binary build using the information from that directory. If git is not installed, the behavior should be to treat the directory as input for a binary type of build. PR https://github.com/openshift/origin/pull/10135 PR https://github.com/openshift/origin/pull/10135 merged. A fix will be included when OSE is rebased with the latest origin. This has been merged and is in OSE v3.3.0.14 or newer. Test with openshift v3.3.0.14 kubernetes v1.3.0+57fb9ac etcd 2.3.0+git reproduce steps: 1.Clone a source code repo to localhost $ git clone https://github.com/openshift/ruby-hello-world 2.Remove origin remote url $ cd ruby-hello-world $ git remote remove origin 3.Create an application via "oc new-app" $ oc new-app . 4.Start new build $ oc start-build ruby-22-centos7 --from-repo=. 5.Check build status actual result: I.git is installed-- 3.Will create a binary build 5.build is successful II. git is not installed-- 4. Uploading "." at commit "HEAD" as binary input for the build ... error: the directory "." is not a valid Git repository: git binary not available Result match with comment2 But if git is not installed in local, when I create an application from a remote repo: $ oc new-app https://github.com/openshift/ruby-hello-world output: error: unable to load template file "https://github.com/openshift/ruby-hello-world": yaml: line 6: mapping values are not allowed in this context error: no match for "https://github.com/openshift/ruby-hello-world" The 'oc new-app' command will match arguments to the following types: 1. Images tagged into image streams in the current project or the 'openshift' project - if you don't specify a tag, we'll add ':latest' 2. Images in the Docker Hub, on remote registries, or on the local Docker engine 3. Templates in the current project or the 'openshift' project 4. Git repository URLs or local paths that point to Git repositories --allow-missing-images can be used to point to an image that does not exist yet. Actual result doesn't match with comment1 @Dongbo Yan, Regarding comment #6: What you describe is not the same issue that was described in comment #1. From the description of your output, it seems new-app was able to create a binary build ok. You get a new message when you try to do a start-build --from-repo (which expects a git repository). Admittedly, the message could be better. But please open a new bug for it (about the output of the 'oc start-build' command when git is not present). Also, if you specify --from-dir instead of --from-repo the build works fine. Regarding comment #7: When you pass a URL to new-app we have no way of knowing by just looking at the URL whether it points to a git repository, a template, or something else. Because git is not installed, we don't check whether the URL is a repository and move on to the check of whether it's a template. That's why you get the output that you get. I'm not sure that we can do better than that. However, if you think the output can be better, please open a separate bug for that as well. Cesar, hi Correct my test steps: 1.Make sure git is not installed $ rpm -e --nodeps git 2.Clone a source code repo to localhost $ git clone https://github.com/openshift/ruby-hello-world 3.Create an application via "oc new-app" $ cd ruby-hello-world $ oc new-app . result: will create a binary build this bug is fixed Will file a bug about the output of "oc start-build" from a repo Dongbo Yan, I submitted a new PR to display a warning that git is not installed. That way at least there is an indication of what happened when you point to a remote repository (comment #7). https://github.com/openshift/origin/pull/10226 Test with openshift v3.3.0.17 kubernetes v1.3.0+507d3a7 etcd 2.3.0+git If git is not installed, create a application from remote repo: $ oc new-app https://github.com/openshift/ruby-hello-world always can get the output: warning: Cannot find git. Ensure that it is installed and in your path. Git is required to work with git repositories. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2016:1933 |