Process YAML File step of the Kubernetes plugin throwing error if the image name has / slash

7/20/2019

The image in the deployment yaml is in the below format :

'${DockerRegistry}/${orgName}/${projectName}/${ImageName}:${version}'

There are 3 forward slashes in the image name after the docker registry name and this is causing an error. I tried with Kubernetes plugin of 16, 17, 18 & 19 and Process Yaml step of Kubernetes is throwing the below error.

Loading /opt/ibm-ucd/agent/var/work/lr-central-credit-register/common/openshift/dc.yml The desired versions for existing image components is [:] Creating ibm-ucd-kubernetes.yaml Creating component: cbrpoc-loan-requests-cbrpoc-loan-requests/lr-central-credit-register Caught: java.io.IOException: 400 Error processing command: Name cannot contain the following characters: / \ [ ] % java.io.IOException: 400 Error processing command: Name cannot contain the following characters: / \ [ ] % at com.urbancode.ud.client.UDRestClient.invokeMethod(UDRestClient.java:225) at com.urbancode.ud.client.ComponentClient.createComponent(ComponentClient.java:180) at processyaml.createComponent(processyaml.groovy:481) at processyaml.this$4$createComponent(processyaml.groovy) at processyaml$_run_closure6.doCall(processyaml.groovy:362) at processyaml.run(processyaml.groovy:325)
-- anusha gadipudi
kubernetes
plugins
ucd

1 Answer

7/26/2019

According to the official documentation of Docker Registry HTTP API V2

A repository name is broken up into path components. A component of a repository name must be at least one lowercase, alpha-numeric characters, optionally separated by periods, dashes or underscores. More strictly, it must match the regular expression [a-z0-9]+(?:[._-][a-z0-9]+)*. If a repository name has two or more path components, they must be separated by a forward slash (“/”). The total length of a repository name, including slashes, must be less than 256 characters.

Please make sure you are using Docker Registry HTTP API V2 and follow all the above rules.

While the V1 registry protocol is usable, there are several problems with the architecture that have led to V2.

Additionally, you can try to use Docker Tag

Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE

More info with examples lined above.

Please let me know if that helped.

-- OhHiMark
Source: StackOverflow