Description of problem: In online this bug is fixed, https://bugzilla.redhat.com/show_bug.cgi?id=1223252 1.when use "oc lable" command to update resource label with empty value, it can success. But when use this label to filter the resource, it tip the label invalid. So we shouldn't update resource label with empty value. 2.When use invalid characters as the label value, the tip should be friendly. Version-Release number of selected component (if applicable): openshift-0.6.0.0-0.git.55.733cf86.el7ose.x86_64 openshift-master-0.6.0.0-0.git.55.733cf86.el7ose.x86_64 How reproducible: Always Steps to Reproduce: 1. Create a pod # oc create -f hello-openshift/hello-pod.json 2. Update the pod label with empty value. # oc label pods hello-openshift status= 3. Add label with invalid value # oc label pods hello-openshift status=$%@# 4.Check the pod label info [root@dhcp-128-7 examples]# oc describe pod hello-openshift Name: hello-openshift Image(s): openshift/hello-openshift Host: minion2.cluster.local/10.14.6.141 Labels: name=hello-openshift,status= Status: Running Replication Controllers: <none> Containers: hello-openshift: Image: openshift/hello-openshift State: Running Started: Thu, 11 Jun 2015 15:36:40 +0800 Ready: True Restart Count: 0 Actual results: 2.Update the label successfully # oc label pods hello-openshift status= NAME READY REASON RESTARTS AGE hello-openshift 1/1 Running 0 1m 3.# oc label pods hello-openshift status=$%@# Error from server: Pod "hello-openshift" is invalid: [metadata.labels: invalid value '$%@#': must have at most 63 characters, matching regex (([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?: e.g. "MyValue" or "", metadata.labels: invalid value '$%@#': must have at most 63 characters, matching regex (([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?: e.g. "MyValue" or ""] Expected results: 2.Can't update label with empty value 3.When use invalid value, the tip should be friendly. Additional info:
Putting on MODIFIED, will be fixed in the next OSE branch.
In the latest ose env, can't fix this issue. Waiting for the next OSE branch.
Test on latest ose env again. Still have this issue. [root@dhcp-128-7 sample-app]# oc version oc v0.6.0.1-78-g1c816ed kubernetes v0.17.1-804-g496be63 openshift master version: openshift-master-0.6.0.1-0.git.78.1c816ed.el7ose.x86_64 Step: 1. Set the label with empty value. [root@dhcp-128-7 sample-app]# oc label pods database-1-deploy status= -n dma1 NAME READY REASON RESTARTS AGE database-1-deploy 1/1 Running 0 2h 2. Check the lavel [root@dhcp-128-7 sample-app]# oc describe pods database-1-deploy -n dma1 Name: database-1-deploy Image(s): registry.access.redhat.com/openshift3/ose-deployer:v0.6.0.1 Host: minion2.cluster.local/10.14.6.134 Labels: openshift.io/deployer-pod-for.name=database-1,status= Status: Running IP: 10.1.1.19 Replication Controllers: <none> Containers: deployment: Image: registry.access.redhat.com/openshift3/ose-deployer:v0.6.0.1 State: Running Started: Mon, 15 Jun 2015 13:49:13 +0800 Ready: True Restart Count: 0 Conditions: Type Status Ready True No events.
Fixed in https://github.com/openshift/origin/pull/3200
This is a bug about ose not origin bug. We should merge the pull request to ose code repo too, not just only on origin. [root@master tmp]# rpm -qa|grep openshift openshift-3.0.0.1-1.git.4.eab4c86.el7ose.x86_64 tuned-profiles-openshift-node-3.0.0.1-1.git.4.eab4c86.el7ose.x86_64 openshift-master-3.0.0.1-1.git.4.eab4c86.el7ose.x86_64 openshift-node-3.0.0.1-1.git.4.eab4c86.el7ose.x86_64 openshift-sdn-ovs-3.0.0.1-1.git.4.eab4c86.el7ose.x86_64 1. Set label with empty value. [root@master tmp]# oc label pods hello-openshift status= -n dma1 NAME READY REASON RESTARTS AGE hello-openshift 1/1 Running 0 54s 2. Set label with invalid value. [root@master tmp]# oc label pods hello-openshift color=%$#@ -n dma1 Error from server: Pod "hello-openshift" is invalid: [metadata.labels: invalid value '%0@': must have at most 63 characters, matching regex (([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?: e.g. "MyValue" or "", metadata.labels: invalid value '%0@': must have at most 63 characters, matching regex (([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?: e.g. "MyValue" or ""]
The referenced pull request is in openshift-3.0.1.0-0.git.133.b1c1f03.el7ose.x86_64.rpm Puddle: http://buildvm-devops.usersys.redhat.com/puddle/build/OpenShiftEnterprise/3.0/2015-07-07.1/RH7-RHOSE-3.0/x86_64/os/
Test on ose env. this bug is fixed. Version: openshift-3.0.1.0-0.git.133.b1c1f03.el7ose.x86_64 openshift-master-3.0.1.0-0.git.133.b1c1f03.el7ose.x86_64 Steps: [root@master tmp]# oc label pods hello-openshift status= -n dma1 error: invalid label spec: status= see 'oc label -h' for help. [root@master tmp]# oc label pods hello-openshift status=$%@# error: invalid label spec: status=$%!@(MISSING)# see 'oc label -h' for help.
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-2015:1540