Description of problem: Below error appears when try to oc new-app with mongodb:latest or mongodb:3.6: $ oc new-app --image-stream=mongodb:latest --env=MONGODB_USER=tester --env=MONGODB_PASSWORD=xxx --env=MONGODB_DATABASE=testdb --env=MONGODB_ADMIN_PASSWORD=yyy --> Found image f857d36 (4 weeks old) in image stream "openshift/mongodb" under tag "latest" for "openshift/mongodb:latest" MongoDB 3.6 ----------- MongoDB (from humongous) is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas. This container image contains programs to run mongod server. Tags: database, mongodb, rh-mongodb36 * This image will be deployed in deployment config "mongodb" * Port 27017/tcp will be load balanced by service "mongodb" * Other containers can access this service through the hostname "mongodb" * This image declares volumes and will default to use non-persistent, host-local storage. You can add persistent volumes later by running 'oc set volume dc/mongodb --add ...' --> Creating resources ... error: ImageStreamTag.image.openshift.io "mongodb:latest" is invalid: metadata.labels: Invalid value: "openshift/mongodb:latest": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?') error: DeploymentConfig.apps.openshift.io "mongodb" is invalid: metadata.labels: Invalid value: "openshift/mongodb:latest": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?') error: Service "mongodb" is invalid: metadata.labels: Invalid value: "openshift/mongodb:latest": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?') --> Failed No such issue when run oc new-app without tag defined. Version-Release number of selected component (if applicable): Client Version: v4.3.0 Server Version: 4.3.0-0.nightly-2019-11-07-172437 Kubernetes Version: v1.16.2 How reproducible: Always Steps to Reproduce: 1.oc new-app --image-stream=mongodb:latest --env=MONGODB_USER=tester --env=MONGODB_PASSWORD=xxx --env=MONGODB_DATABASE=testdb --env=MONGODB_ADMIN_PASSWORD=yyy 2. 3. Actual results: Command fail. Expected results: Should succeed like 4.1 version: [wzheng@openshift-qe 4.1.z]$ ./oc new-app --image-stream=openshift/mongodb:latest --env=MONGODB_USER=tester --env=MONGODB_PASSWORD=xxx --env=MONGODB_DATABASE=testdb --env=MONGODB_ADMIN_PASSWORD=yyy --name=mydb --> Found image f857d36 (4 weeks old) in image stream "openshift/mongodb" under tag "latest" for "openshift/mongodb:latest" MongoDB 3.6 ----------- MongoDB (from humongous) is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas. This container image contains programs to run mongod server. Tags: database, mongodb, rh-mongodb36 * This image will be deployed in deployment config "mydb" * Port 27017/tcp will be load balanced by service "mydb" * Other containers can access this service through the hostname "mydb" * This image declares volumes and will default to use non-persistent, host-local storage. You can add persistent volumes later by running 'oc set volume dc/mydb --add ...' --> Creating resources ... imagestreamtag.image.openshift.io "mydb:latest" created deploymentconfig.apps.openshift.io "mydb" created service "mydb" created --> Success Application is not exposed. You can expose services to the outside world by executing one or more of the commands below: 'oc expose svc/mydb' Run 'oc status' to view your app. [wzheng@openshift-qe 4.1.z]$ ./oc version Client Version: version.Info{Major:"4", Minor:"1+", GitVersion:"v4.1.23-201911050122+26eb389-dirty", GitCommit:"26eb389", GitTreeState:"dirty", BuildDate:"2019-11-05T08:31:35Z", GoVersion:"go1.11.13", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.4+5b8586a", GitCommit:"5b8586a", GitTreeState:"clean", BuildDate:"2019-11-05T08:31:29Z", GoVersion:"go1.11.13", Compiler:"gc", Platform:"linux/amd64"} [wzheng@openshift-qe 4.1.z]$ ./oc version --short Client Version: v4.1.23-201911050122+26eb389-dirty Server Version: v1.13.4+5b8586a Additional info:
How did this fail and the fix for Bug #1767163 pass? Please make sure that the version of oc used to test is aligned with the server version.
(In reply to Adam Kaplan from comment #1) > How did this fail and the fix for Bug #1767163 pass? Please make sure that > the version of oc used to test is aligned with the server version. After upgrade to latest oc, cannot reproduce this bug now, sorry for the confusion: [wzheng@openshift-qe 4.3]$ oc new-app --image-stream=mongodb:3.6 --env=MONGODB_USER=tester --env=MONGODB_PASSWORD=xxx --env=MONGODB_DATABASE=testdb --env=MONGODB_ADMIN_PASSWORD=yyy --> Found image f857d36 (4 weeks old) in image stream "openshift/mongodb" under tag "3.6" for "mongodb:3.6" MongoDB 3.6 ----------- MongoDB (from humongous) is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas. This container image contains programs to run mongod server. Tags: database, mongodb, rh-mongodb36 * This image will be deployed in deployment config "mongodb" * Port 27017/tcp will be load balanced by service "mongodb" * Other containers can access this service through the hostname "mongodb" * This image declares volumes and will default to use non-persistent, host-local storage. You can add persistent volumes later by running 'oc set volume dc/mongodb --add ...' --> Creating resources ... imagestreamtag.image.openshift.io "mongodb:3.6" created deploymentconfig.apps.openshift.io "mongodb" created service "mongodb" created --> Success Application is not exposed. You can expose services to the outside world by executing one or more of the commands below: 'oc expose svc/mongodb' Run 'oc status' to view your app. [wzheng@openshift-qe 4.3]$ oc version Client Version: v4.3.0 Server Version: 4.3.0-0.nightly-2019-11-11-182924 Kubernetes Version: v1.16.2
Reopen this bug since if add openshift before imagestream "--image-stream=openshift/mongodb:latest", still failed: $ oc new-app --image-stream=openshift/mongodb:latest --env=MONGODB_USER=tester --env=MONGODB_PASSWORD=xxx --env=MONGODB_DATABASE=testdb --env=MONGODB_ADMIN_PASSWORD=yyy --> Found image f857d36 (4 weeks old) in image stream "openshift/mongodb" under tag "latest" for "openshift/mongodb:latest" MongoDB 3.6 ----------- MongoDB (from humongous) is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas. This container image contains programs to run mongod server. Tags: database, mongodb, rh-mongodb36 * This image will be deployed in deployment config "mongodb" * Port 27017/tcp will be load balanced by service "mongodb" * Other containers can access this service through the hostname "mongodb" * This image declares volumes and will default to use non-persistent, host-local storage. You can add persistent volumes later by running 'oc set volume dc/mongodb --add ...' --> Creating resources ... error: ImageStreamTag.image.openshift.io "mongodb:latest" is invalid: metadata.labels: Invalid value: "openshift/mongodb": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?') error: DeploymentConfig.apps.openshift.io "mongodb" is invalid: metadata.labels: Invalid value: "openshift/mongodb": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?') error: Service "mongodb" is invalid: metadata.labels: Invalid value: "openshift/mongodb": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?') --> Failed
$ oc version Client Version: v4.3.0 Server Version: 4.3.0-0.nightly-2019-11-12-185229 Kubernetes Version: v1.16.2
Verified with latest oc version: openshift-clients.x86_64 0:4.3.0-201911150628.git.1.bfb5907.el7
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-2020:0062