Bug 1967745

Summary: When setting DNS node placement by toleration to not tolerate master node, effect value should not allow string other than "NoExecute"
Product: OpenShift Container Platform Reporter: jechen <jechen>
Component: NetworkingAssignee: Miciah Dashiel Butler Masters <mmasters>
Networking sub component: DNS QA Contact: jechen <jechen>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: high CC: aos-bugs, mmasters
Version: 4.8   
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-27 23:11:27 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 jechen 2021-06-03 18:59:17 UTC
Description of problem:
When trying to set DNS node placement by toleration to not tolerate master nodes, effect value currently takes misspelled string other than "NoExecute".   A check should be added that only string "NoExecute" is allowed, any other string should not allowed to be set for toleration effect.

Version-Release number of selected component (if applicable):
 4.8.0-0.nightly-2021-06-03-101158

How reproducible:
Edit toleration for default DNS operator with misspelled word "NoExcute"

$ oc edit dns.operator default
spec:
  nodePlacement:
    tolerations:
    - effect: NoExecute
      key: my-dns-test
      operators: Equal
      value: abc
      tolerationSeconds: 3600

Steps to Reproduce:
1.
2.
3.

Actual results:
the string was taken, editing was successful
$ oc get dns.operator default -oyaml
<--snip-->
spec:
  nodePlacement:
    tolerations:
    - effect: NoExcute      <---- should not be allowed
      key: my-dns-test
      tolerationSeconds: 3600
      value: abc
<--snip-->


Expected results:
The string should not be allowed, editing should not be successful.  Only correct string "NoExecute" is allowed.

Additional info:

Comment 2 jechen 2021-06-08 14:16:49 UTC
Verified in 4.8.0-0.nightly-2021-06-08-034312

$ oc get clusterversions.config.openshift.io 
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.8.0-0.nightly-2021-06-08-034312   True        False         20m     Cluster version is 4.8.0-0.nightly-2021-06-08-034312


Verified on valid string "NoExecute" was accepted, any other invalid string was rejected, was not allowed to be edited into DNS operator yaml file.

Comment 5 errata-xmlrpc 2021-07-27 23:11:27 UTC
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 (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), 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/RHSA-2021:2438