Fedora Account System
Red Hat Associate
Red Hat Customer
Description: When create namespace with less than 4 characters in name/label, it has no warning; but if build under it, there will be warning about "Build error: API error (500): Invalid namespace name (w2). Cannot be fewer than 4 or more than 30 characters." Version-Release number of selected component (if applicable): openshift-sdn-master-0.4-1.el7.x86_64 openshift-master-0.2.2-0.git.83.6d09bd9.el7ose.x86_64 openshift-sdn-0.4-1.el7.x86_64 openshift-0.2.2-0.git.83.6d09bd9.el7ose.x86_64 kubernetes v0.10.0-dev How reproducible: always steps to Reproduce: 1. Create namespace with less than 4 characters 2. Create resouces under this namespace 3. Triger build Actual results: Build will be failed with below error: [root@ose-v3-beta1-master sample-app]# osc build-logs 1078d163-adbe-11e4-a753-fa163ee200ce -n w2 2015-02-06T05:08:11.915349657Z Cloning into '/tmp/docker-build650986152'... 2015-02-06T05:08:12.772927359Z 2015/02/06 05:08:12 Build error: API error (500): Invalid namespace name (w2). Cannot be fewer than 4 or more than 30 characters. Expected results: If namespace cannnot be create with less than 4 characters, validation should be earlier, like during creation. Additional info:
*** Bug 1218983 has been marked as a duplicate of this bug. ***
Also see https://github.com/openshift/origin/issues/1232
Namespaces are a Kubernetes object, and builds are an OpenShift object, so we can't place requirements on namespace name validation based on builds.
The v2 docker registry has the following restrictions on image repository path components: 1. total length <= 255 2. each segment length >= 2 3. only valid characters are a-z0-9_.- The namespace and the image stream name are combined with a "/" to form an image repository path. https://github.com/openshift/origin/pull/2351 will add the following validation: 1. Require Project names to be >= 2 characters on creation 2. Require ImageStream namespaces to be >= 2 characters 3. Require ImageStream namespace+'/'+name to be <= 255 characters 4. Require ImageStream names to be valid docker image repository names 5. Validate dockerImageReference path component length and characters To ensure we don't break updating an existing project/namespace that was created with a single character name, allow updating projects with names < 2 characters
Merged in https://github.com/openshift/origin/pull/2351 Note that "5. Validate dockerImageReference path component length and characters" was not done because it was too impactful a change.
Checked with fedora_1614, and Can not reproduce this issue with namespace which name is less than 4 chars.