Bug 1819112
| Summary: | Git repository ssh url format | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Maria Alonso <malonso> |
| Component: | Dev Console | Assignee: | cvogt |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Gajanan More <gamore> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 4.2.z | CC: | aos-bugs, jhadvig, jokerman, nmukherj, rmarasch, wzheng |
| Target Milestone: | --- | ||
| Target Release: | 4.3.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: |
Cause: Import from Git form used a regular expression to validate the Git URL. Unfortunately it was too restrictive and disallowed certain URLs which are actually valid.
Consequence: The user could not enter what they considered to be a valid Git URL and complete the form.
Fix: The Git URL regular expression used for validation has been updated.
Result: All valid Git URLs are now accepted.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-04-21 22:03:56 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: | |||
| Bug Depends On: | 1766350, 1771851 | ||
| Bug Blocks: | |||
|
Description
Maria Alonso
2020-03-31 08:50:26 UTC
Referring to our docs, it isn't entirely clear which URI formats are supported for git source [1]. `ssh://` support is implied by the automatic source secret linking feature [2]. As mentioned in the description, the `[user@]server:project.git` is a valid work-around. [1] https://docs.openshift.com/container-platform/4.3/builds/creating-build-inputs.html#source-code_creating-build-inputs [2] https://docs.openshift.com/container-platform/4.3/builds/creating-build-inputs.html#build-auto-add-source-clone-secrets_creating-build-inputs For the record: I managed to run a build successfully with the following BuildConfig(using version 4.5):
kind: BuildConfig
apiVersion: v1
metadata:
name: hi
spec:
runPolicy: Serial
source:
git:
uri: ssh://git/ricardomaraschini/hi
sourceSecret:
name: hi
strategy:
dockerStrategy: {}
output:
to:
kind: ImageStreamTag
name: hi:latest
I had to create a secret containing my ssh private keys(see below) but it worked as expected.
$ oc create secret generic git-secret \
--from-file=ssh-privatekey=private.key \
--type=kubernetes.io/ssh-auth
Just checked on a cluster version 4.2[1] and it works using the same approach I have used on Comment 3. I have also tested directly from the command line[2] and it works as well. Maria, add to this ticket the exact commands you are running so I can replicate. [1]: [rmarasch@loaner ~]$ oc version Client Version: openshift-clients-4.2.29-202004110432 Server Version: 4.2.29 Kubernetes Version: v1.14.6-152-g117ba1f [rmarasch@loaner ~]$ [2]: oc create secret generic hi \ --from-file=ssh-privatekey=resources/github.key \ --type=kubernetes.io/ssh-auth oc new-app ssh://git/ricardomaraschini/hi --source-secret=hi Hi Ricardo, Sorry, I thought I put it in the description but I didn't... This issue happens when creating new-app from console, not when creating it from the cli. Sorry for the inconvenience. Regards MarĂa Thanks Maria, I am migrating this to Management Console component as it seems more adequate. Re-assigning to the DevConsole team since this belongs to their package. This issue was addressed in 4.3 by improving the validation regex. |