Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1781522

Summary: `oc adm taint` without effect given failed with confusing error
Product: OpenShift Container Platform Reporter: Liang Xia <lxia>
Component: ocAssignee: Sally <somalley>
Status: CLOSED NOTABUG QA Contact: zhou ying <yinzhou>
Severity: low Docs Contact:
Priority: medium    
Version: 4.3.0CC: aos-bugs, jokerman, maszulik, mfojtik, yinzhou
Target Milestone: ---   
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1781520 Environment:
Last Closed: 2020-05-04 19:37:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1781520    
Bug Blocks:    

Description Liang Xia 2019-12-10 08:10:05 UTC
+++ This bug was initially created as a clone of Bug #1781520 +++

Description of problem:
Try to add taint,
$ oc adm taint nodes lxia10-j6jlg-w-a-drb5b.c.openshift-qe.internal disks=localstorage
it failed with below errors,
error: invalid taint spec: disks=localstorage, name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName',  or 'my.name',  or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]')
See 'oc adm taint -h' for help and examples

The help info shows "A taint consists of a key, value, and effect". Above failure prompts about name part, this confuses user. Instead it should prompt no effect is given.


Version-Release number of selected component (if applicable):
openshift-clients-4.3.0-201912060615.git.1.37110a9.el7.x86_64
$ oc version -o yaml --client
clientVersion:
  buildDate: "2019-12-06T11:24:15Z"
  compiler: gc
  gitCommit: 3fa38ed2761a75d4c648acfc8ac14df930219ed5
  gitTreeState: clean
  gitVersion: v4.3.0
  goVersion: go1.12.12
  major: ""
  minor: ""
  platform: linux/amd64


How reproducible:
Always

Steps to Reproduce:
1. $ oc adm taint nodes lxia10-j6jlg-w-a-drb5b.c.openshift-qe.internal disks=localstorage

Actual results:
$ oc adm taint nodes lxia10-j6jlg-w-a-drb5b.c.openshift-qe.internal disks=localstorage
error: invalid taint spec: disks=localstorage, name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName',  or 'my.name',  or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]')
See 'oc adm taint -h' for help and examples


Expected results:
Taints added.


Additional info:

Comment 1 Maciej Szulik 2020-05-04 19:37:50 UTC
> The help info shows "A taint consists of a key, value, and effect". Above failure prompts about name part, this confuses user. Instead it should prompt no effect is given.

But a taint without effect is perfectly valid, that's why in this case this complains about wrong key.

This is not a bug and I'm closing this as such.