Description of problem: When invalid env name is carried in 'oc set env', oc gives incorrect message Version-Release number of selected component (if applicable): oc v1.3.0-alpha.3+9b3ae69 kubernetes v1.3.0+507d3a7 How reproducible: Always Steps to Reproduce: 1.Create app resources # oc process -f /data/src/github.com/openshift/origin/examples/sample-app/application-template-stibuild.json | oc create -f - 2.Add env for rc 'database-1' with correct env name # oc set env rc/database-1 test=1234 -n yapei-bug replicationcontroller "database-1" updated 3.Add another env for rc 'database-1' with invalid env name # oc set env rc/database-1 test@-abc=1234 -n yapei-bug there is no need to specify a resource type as a separate argument when passing arguments in resource/name form (e.g. 'oc get resource/<resource_name>' instead of 'oc get resource resource/<resource_name>' 4. oc set env rc/database-1 test-ttt=aaa1234 error: ReplicationController "database-1" is invalid: [spec.template.spec.containers[0].env[6].name: Invalid value: "test-ttt": must be a C identifier (matching regex [A-Za-z_][A-Za-z0-9_]*): e.g. "my_name" or "MyName", spec.template.spec.containers[0].env[6].name: Invalid value: "test-ttt": must be a C identifier (matching regex [A-Za-z_][A-Za-z0-9_]*): e.g. "my_name" or "MyName"] Duplicate error message is tracked in https://bugzilla.redhat.com/show_bug.cgi?id=1257800 Actual results: 3. Error message is not correct because I didn't specify a resource type as a separate argument: there is no need to specify a resource type as a separate argument when passing arguments in resource/name form (e.g. 'oc get resource/<resource_name>' instead of 'oc get resource resource/<resource_name>' 4. Gives reasonable error message Expected results: 3. Should give error message about invalid env name like step4 Additional info:
Related PR: https://github.com/openshift/origin/pull/10619
Fixed in https://github.com/openshift/origin/pull/10619
Fixed in: openshift v1.3.0-alpha.3+d8c9694 kubernetes v1.3.0+507d3a7 etcd 2.3.0+git $ oc set env rc/database-1 test-ttt=aaa1234 error: environment variables must be of the form key=value and can only contain letters, numbers, and underscores Now prompt meaningful error message.