Bug 1392764 - oc new-app can create app with --name have more than 24 characters
Summary: oc new-app can create app with --name have more than 24 characters
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Jim Minter
QA Contact: Wang Haoran
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-08 08:02 UTC by Wang Haoran
Modified: 2017-07-24 14:11 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2017-04-12 19:16:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0884 0 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.5 RPM Release Advisory 2017-04-12 22:50:07 UTC

Description Wang Haoran 2016-11-08 08:02:19 UTC
Description of problem:

oc new-app can create app with --name have more than 24 characters
Version-Release number of selected component (if applicable):


How reproducible:
Alwasy

Steps to Reproduce:
1.oc new-app --code=https://github.com/openshift/ruby-ex --name=$(a="";for i in `seq 26`;do a=${a}a;done; echo $a )
2.
3.

Actual results:
--> Found image 5e772d2 (4 days old) in image stream "openshift/ruby" under tag "2.3" for "ruby"

    Ruby 2.3 
    -------- 
    Platform for building and running Ruby 2.3 applications

    Tags: builder, ruby, ruby23, rh-ruby23

    * The source repository appears to match: ruby
    * A source build using source code from https://github.com/openshift/ruby-ex will be created
      * The resulting image will be pushed to image stream "aaaaaaaaaaaaaaaaaaaaaaaaaa:latest"
      * Use 'start-build' to trigger a new build
    * This image will be deployed in deployment config "aaaaaaaaaaaaaaaaaaaaaaaaaa"
    * Port 8080/tcp will be load balanced by service "aaaaaaaaaaaaaaaaaaaaaaaaaa"
      * Other containers can access this service through the hostname "aaaaaaaaaaaaaaaaaaaaaaaaaa"

--> Creating resources ...
    imagestream "aaaaaaaaaaaaaaaaaaaaaaaaaa" created
    buildconfig "aaaaaaaaaaaaaaaaaaaaaaaaaa" created
    deploymentconfig "aaaaaaaaaaaaaaaaaaaaaaaaaa" created
    service "aaaaaaaaaaaaaaaaaaaaaaaaaa" created
--> Success
    Build scheduled, use 'oc logs -f bc/aaaaaaaaaaaaaaaaaaaaaaaaaa' to track its progress.
    Run 'oc status' to view your app.


Expected results:
should fail

Additional info:

Comment 2 Jim Minter 2016-11-14 11:07:22 UTC
Wang, I'm not sure it's a problem per se that oc new-app can create an app when --name is longer than 24 characters.  However I do think it's an issue that oc new-app's creation of the dc can fail if --name is too long, but is nonetheless shorter than the 63 character limit which we validate.

Comment 3 Wang Haoran 2016-11-15 02:51:59 UTC
(In reply to Jim Minter from comment #2)
It's designed the --name is no longer than 24 characters previously, but if the design changed, we can ignore this.

Comment 4 Jim Minter 2017-01-05 10:20:44 UTC
https://github.com/openshift/origin/pull/12394

Comment 5 Jim Minter 2017-02-10 14:15:50 UTC
https://github.com/openshift/origin/pull/12585

Comment 6 Troy Dawson 2017-02-10 22:49:42 UTC
This has been merged into ocp and is in OCP v3.5.0.19 or newer.

Comment 8 Dongbo Yan 2017-02-14 12:22:20 UTC
Verified

openshift v3.5.0.20+87266c6
kubernetes v1.5.2+43a9be4
etcd 3.1.0

# oc new-app --code=https://github.com/openshift/ruby-ex --name=$(a="";for i in `seq 59`;do a=${a}a;done; echo $a )
error: invalid name: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa. Must be an a lower case alphanumeric (a-z, and 0-9) string with a maximum length of 58 characters, where the first character is a letter (a-z), and the '-' character is allowed anywhere except the first or last character.

Comment 10 errata-xmlrpc 2017-04-12 19:16: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-2017:0884


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