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:
https://github.com/openshift/origin/pull/11895/files
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.
(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.
https://github.com/openshift/origin/pull/12394
https://github.com/openshift/origin/pull/12585
This has been merged into ocp and is in OCP v3.5.0.19 or newer.
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.
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