Bug 1785791

Summary: SriovNetworkAttachment `spoof_check` string must be quoted
Product: OpenShift Container Platform Reporter: Jason Boxman <jboxman>
Component: NetworkingAssignee: Peng Liu <pliu>
Networking sub component: SR-IOV QA Contact: zhaozhanqi <zzhao>
Status: CLOSED NOTABUG Docs Contact:
Severity: unspecified    
Priority: unspecified CC: bbennett, pliu
Version: 4.3.0   
Target Milestone: ---   
Target Release: 4.4.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: 2020-01-20 14:43:51 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 Jason Boxman 2019-12-21 01:51:46 UTC
Description of problem:

Because go-yaml has inconsistent boolean support[0], a user needs to quote the values "on" and "off" for the `spoof_check` and `trust_vf` keys[1]. Other string values do not need to be quoted, so this behavior is unexpected.

If the code checked for either a string or a boolean value, that would allow someone to specify a boolean directly, or avoid quoting "on" and "off" and go-yaml 1.2 will convert it to a boolean automatically.

[0] https://github.com/go-yaml/yaml/issues/214
[1] https://github.com/pliurh/openshift-docs/pull/4#discussion_r350988521

Comment 1 Peng Liu 2020-01-13 14:07:41 UTC
(In reply to Jason Boxman from comment #0)
> Description of problem:
> 
> Because go-yaml has inconsistent boolean support[0], a user needs to quote
> the values "on" and "off" for the `spoof_check` and `trust_vf` keys[1].
> Other string values do not need to be quoted, so this behavior is unexpected.
> 
> If the code checked for either a string or a boolean value, that would allow
> someone to specify a boolean directly, or avoid quoting "on" and "off" and
> go-yaml 1.2 will convert it to a boolean automatically.
> 
> [0] https://github.com/go-yaml/yaml/issues/214
> [1] https://github.com/pliurh/openshift-docs/pull/4#discussion_r350988521

In the CRD, we choose using string instead of boolean intentionally. As a string, it can be in one of three states, "on", "off" or empty, and empty is the default value of a string. When users don't specify these fields in the manifest, the operator will modify the NICs default setting. Therefore I don't think we shall change them to a boolean.