Hide Forgot
Description of problem: Want that all standards url be posible when setting ssh git url. OCP 4 doesn't allow to set 'ssh://[user@]server/project.git' as git repository url, only '[user@]server:project.git' format is allowed Version-Release number of selected component (if applicable): OCP 4 How reproducible: Always. Steps to Reproduce: 1. Try to create a new build with the following ssh url: ssh://git/example/example1.git 2. You get 'Invalid Git URL.' error 3. Only the following format is allowed: git:example/example1.git Actual results: 'Invalid Git URL.' error appears Expected results: That this url format is accepted Additional info:
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.