Bug 1230581
| Summary: | Shouldn't update resource label with empty or invalid value | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | DeShuai Ma <dma> |
| Component: | oc | Assignee: | Fabiano Franz <ffranz> |
| Status: | CLOSED ERRATA | QA Contact: | libra bugs <libra-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 3.0.0 | CC: | adellape, anli, dmcphers, jokerman, libra-onpremise-devel, mkargaki, mmccomas |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | openshift-3.0.1.0-0.git.133.b1c1f03.el7ose.x86_64.rpm | Doc Type: | Bug Fix |
| Doc Text: |
Previously using the CLI, labels could be set to empty values, and setting labels to invalid values produced an unfriendly error. This bug fix updates the CLI to no longer allow setting labels to empty values, and setting labels to invalid values produces a better error message.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-08-03 20:17:24 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
DeShuai Ma
2015-06-11 08:05:31 UTC
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.
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 |