Bug 1767163 - new-app with imagestream results in bad k8s labels
Summary: new-app with imagestream results in bad k8s labels
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.3.0
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-30 19:54 UTC by Adam Kaplan
Modified: 2020-01-23 11:10 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-01-23 11:10:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 138 0 'None' closed Bug 1767163: fix app.kubernetes.io/name to use just IS name 2020-01-29 10:00:46 UTC
Github openshift origin pull 24096 0 'None' closed Bug 1767163: Verify new-app works with imagestream 2020-01-29 10:00:46 UTC
Red Hat Product Errata RHBA-2020:0062 0 None None None 2020-01-23 11:10:30 UTC

Internal Links: 1770144

Description Adam Kaplan 2019-10-30 19:54:59 UTC
Description of problem:

oc new-app with an imagestream results in bad labels being created on all generated objects.

Version-Release number of selected component (if applicable): 4.3.0


How reproducible: Always


Steps to Reproduce:

oc new-app https://github.com/ricardozanini/spring-todo --image-stream=java:8

Actual results:

All objects fail with invalid label messages:
error: ImageStream.image.openshift.io "spring-todo" is invalid: metadata.labels: Invalid value: "java:8": 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: BuildConfig.build.openshift.io "spring-todo" is invalid: metadata.labels: Invalid value: "java:8": 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 "spring-todo" is invalid: metadata.labels: Invalid value: "java:8": 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 "spring-todo" is invalid: metadata.labels: Invalid value: "java:8": 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])?')



Expected results:

Imagestream, builds, and template components deploy with valid labels.


Additional info:

This is a regression from 4.2 - works in that version of oc.

Comment 1 Adam Kaplan 2019-10-30 19:57:02 UTC
Marking this as a blocker for 4.3.0.

DevEx would normally own this, but we didn't make any changes here.

Comment 2 Maciej Szulik 2019-11-06 12:17:57 UTC
https://github.com/openshift/oc/pull/138 merged

Comment 4 zhou ying 2019-11-08 07:07:40 UTC
Can't reproduce the issue with latest version now:
[root@dhcp-140-138 ~]# oc version
Client Version: v4.3.0
Server Version: 4.3.0-0.nightly-2019-11-07-172437
Kubernetes Version: v1.16.2


[root@dhcp-140-138 ~]# oc new-app https://github.com/ricardozanini/spring-todo --image-stream=java:8
--> Found image bfb995c (3 weeks old) in image stream "openshift/java" under tag "8" for "java:8"

    Java Applications 
    ----------------- 
    Platform for building and running plain Java applications (fat-jar and flat classpath)

    Tags: builder, java

    * The source repository appears to match: jee
    * A source build using source code from https://github.com/ricardozanini/spring-todo will be created
      * The resulting image will be pushed to image stream tag "spring-todo:latest"
      * Use 'oc start-build' to trigger a new build
    * This image will be deployed in deployment config "spring-todo"
    * Ports 8080/tcp, 8443/tcp, 8778/tcp will be load balanced by service "spring-todo"
      * Other containers can access this service through the hostname "spring-todo"

--> Creating resources ...
    imagestream.image.openshift.io "spring-todo" created
    buildconfig.build.openshift.io "spring-todo" created
    deploymentconfig.apps.openshift.io "spring-todo" created
    service "spring-todo" created
--> Success
    Build scheduled, use 'oc logs -f bc/spring-todo' to track its progress.
    Application is not exposed. You can expose services to the outside world by executing one or more of the commands below:
     'oc expose svc/spring-todo' 
    Run 'oc status' to view your app.

Comment 6 errata-xmlrpc 2020-01-23 11:10:15 UTC
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


Note You need to log in before you can comment on or make changes to this bug.