Bug 1836818 - csisnapshotcontrollers.operator.openshift.io api should validate the .spec.logLevel and .spec.operatorLogLevel field
Summary: csisnapshotcontrollers.operator.openshift.io api should validate the .spec.lo...
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 4.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.6.0
Assignee: Jan Safranek
QA Contact: Qin Ping
Depends On:
TreeView+ depends on / blocked
Reported: 2020-05-18 09:00 UTC by Qin Ping
Modified: 2020-10-27 16:00 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Last Closed: 2020-10-27 16:00:11 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github openshift cluster-csi-snapshot-controller-operator pull 38 0 None closed Bug 1836818: Add validation of csisnapshotcontroller 2020-10-12 00:25:47 UTC
Red Hat Product Errata RHBA-2020:4196 0 None None None 2020-10-27 16:00:12 UTC

Description Qin Ping 2020-05-18 09:00:55 UTC
Description of problem:
Now for the csisnapshotcontrollers.spec.logLevel and .spec.operatorLogLevel, we can set any string here. Seems we only support coarse grained logging choices, such as: Normal/Debug/Trace/TraceAll

Version-Release number of selected component (if applicable):
$ oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.5.0-0.nightly-2020-05-17-235851   True        False         3h27m   Cluster version is 4.5.0-0.nightly-2020-05-17-235851

How reproducible:

Steps to Reproduce:
1. Lanch a 4.5 OCP cluster
2. Check the csisnapshotcontroller api
$ oc explain csisnapshotcontrollers.spec.logLevel
3. oc patch csisnapshotcontrollers cluster -p '{"spec": {"logLevel": "testerror"}}' --type=merge
4. check the logLevel with cmd: oc get csisnapshotcontrollers cluster -ojson|jq .spec.logLevel

Actual results:
$ oc explain csisnapshotcontrollers.spec.logLevel
KIND:     CSISnapshotController
VERSION:  operator.openshift.io/v1

FIELD:    logLevel <string>

     logLevel is an intent based logging for an overall component. It does not
     give fine grained control, but it is a simple way to manage coarse grained
     logging choices that operators have to interpret for their operands.

$ oc get csisnapshotcontrollers cluster -ojson|jq .spec.logLevel

$ oc -n openshift-cluster-storage-operator exec csi-snapshot-controller-67645bbd9d-fg69v -- ps -aux|grep snapshot
1000500+       1  0.0  0.0 133324 26724 ?        Ssl  07:45   0:00 /usr/bin/snapshot-controller --v=2 --leader-election=true

Expected results:
run oc explain cmd, can get the valid logLevels and operatorLogLevels.
patch cmd failed, and returned clear err msg.

Master Log:

Node Log (of failed PODs):

PV Dump:

PVC Dump:

StorageClass Dump (if StorageClass used by PV/PVC):

Additional info:

Comment 4 Qin Ping 2020-06-05 02:11:05 UTC
Checked this PR is not included in the `release-4.5` branch, so can not verify it in 4.5.0.

Verified it with 4.6.0-0.ci-2020-06-03-191434, so marked this as verified and change the targetrelease to 4.6.0

Comment 8 errata-xmlrpc 2020-10-27 16:00:11 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 (OpenShift Container Platform 4.6 GA Images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.