1

I tried to follow this guide on deploying an app on OpenShift from my private repository on GitLab. I tried using an SSH authentication key as a deploy key, GitLab personal access token with api scope and entering my GitLab credentials directly.

I've been failing at the step of adding annotation with repository URI to the secret using this command.

$ oc annotate secret/mysecretname \
    'build.openshift.io/source-secret-match-uri-1=https://gitlab.com/username/reponame.git'

I'm getting the following error as a result.

error: at least one annotation update is required
See 'oc annotate -h' for help and examples.
build.openshift.io/source-secret-match-uri-1=https://gitlab.com/username/reponame.git

Result of oc version is as follows, matching the server version shown both in cli and on the about page in the OpenShift web console.

oc v3.10.9
kubernetes v1.10.0+b81c8f8
features: Basic-Auth

Server https://api.starter-us-east-1.openshift.com:443
openshift v3.10.9
kubernetes v1.10.0+b81c8f8
Nik333
  • 58
  • 1
  • 8
  • What version of ``oc`` client are you using and what version of OpenShift are you using? That is, add output of ``oc version`` to your question. You need to ensure that the ``oc`` version is the right version for the cluster, else sometimes strange things can happen. – Graham Dumpleton Jul 15 '18 at 11:53
  • @GrahamDumpleton Added oc version to the question. – Nik333 Jul 15 '18 at 12:43
  • Try running it as ``oc annotate secret mysecretname 'build.openshift.io/source-secret-match-uri-1=https://gitlab.com/username/reponame.git'``. That is, instead of ``secret/mysecretname``, supply those as two separate arguments. Usually you can use either form, but just want to check whether that may be issue, or whether parsing of ``key=value`` is simply broken. – Graham Dumpleton Jul 15 '18 at 13:04
  • FWIW. If I get onto ``starter-us-east-1`` and use ``oc create secret generic mysecretname`` to create a secret, and then run exactly the same command of ``oc annotate secret/mysecretname 'build.openshift.io/source-secret-match-uri-1=https://gitlab.com/username/reponame.git'``, it works fine. What OS is your local computer where you run ``oc``? I am using macOS. – Graham Dumpleton Jul 15 '18 at 13:11
  • Also try using ``oc annotate --loglevel 9 secret/mysecretname 'build.openshift.io/source-secret-match-uri-1=https://gitlab.com/username/reponame.git' --dry-run`` and look at the log output and see if you can work out at what point it appears to fail. That may help to understand why. – Graham Dumpleton Jul 15 '18 at 13:13
  • @GrahamDumpleton Thank you, commands in your first comment works for adding annotation. You can add it as answer and I will accept it. I now have a different problem, but unwilling to spend my time on this, I've already moved to a different host that works perfectly for me. – Nik333 Jul 15 '18 at 13:55

0 Answers0