Bug 1883692

Summary: No validation if set invalid value to spec.logLevel and spec.operatorLogLevel in consoles.operator.openshift.io
Product: OpenShift Container Platform Reporter: Oleg Bulatov <obulatov>
Component: Management ConsoleAssignee: Jakub Hadvig <jhadvig>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: high Docs Contact:
Priority: high    
Version: 4.6CC: aos-bugs, jokerman, obulatov, rmarasch, spadgett, sttts, wzheng, yapei
Target Milestone: ---   
Target Release: 4.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1878040 Environment:
Last Closed: 2020-10-27 16:46:29 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:

Comment 1 Jakub Hadvig 2020-10-01 10:11:12 UTC
This BZ was taken care as part of https://github.com/openshift/console-operator/pull/473 since the PR was bumping dep. packages and fixing multiple issues.

Comment 4 Yadan Pei 2020-10-09 09:27:55 UTC
Change console.config spec.logLevel and spec.operatorLogLevel using `oc edit` and :wq 
# oc edit console.config cluster      // didn't see warning message and it says console.config.openshift.io/cluster edited
spec: 
  operatorLogLevel: abc
  logLevel: abc
console.config.openshift.io/cluster edited

# oc get consoles.config.openshift.io cluster -o json | jq '.spec'      // nothing saved
{}


We didn't see warning message when trying to save the invalid changes 

This is checked against 

# oc version
Client Version: openshift-clients-4.6.0-202006250705.p0-162-g074039a0a
Server Version: 4.6.0-0.nightly-2020-10-08-182439
Kubernetes Version: v1.19.0+db1fc96

Moving back to assigned for further investigation

Comment 5 Samuel Padgett 2020-10-09 12:53:12 UTC
Yadan, it looks like you're editing the wrong resource. It should be

$ oc edit consoles.operators.openshift.io cluster

I see the error message:

# consoles.operator.openshift.io "cluster" was not valid:
# * spec.operatorLogLevel: Unsupported value: "abc": supported values: "", "Normal", "Debug", "Trace", "TraceAll"
# * spec.logLevel: Unsupported value: "abc": supported values: "", "Normal", "Debug", "Trace", "TraceAll"

$ oc version
Client Version: 4.5.0-rc.4
Server Version: 4.6.0-0.nightly-2020-10-09-033719
Kubernetes Version: v1.19.0+d59ce34

It looks like the title is wrong. I'll update. Moving back to ON_QA.

Comment 6 Samuel Padgett 2020-10-09 12:54:31 UTC
Sorry that should be

$ oc edit consoles.operator.openshift.io cluster

Comment 7 Yadan Pei 2020-10-10 02:02:17 UTC
Thank you Sam!

I tried again and I can see warning message when trying to save the changes

# consoles.operator.openshift.io "cluster" was not valid:
# * spec.logLevel: Unsupported value: "abc": supported values: "", "Normal", "Debug", "Trace", "TraceAll"
# * spec.operatorLogLevel: Unsupported value: "abbc": supported values: "", "Normal", "Debug", "Trace", "TraceAll"
#
apiVersion: operator.openshift.io/v1
kind: Console
metadata:
  annotations:
    release.openshift.io/create-only: "true"
  creationTimestamp: "2020-10-09T23:23:25Z"
  generation: 1
  name: cluster
  resourceVersion: "34767"
  selfLink: /apis/operator.openshift.io/v1/consoles/cluster
  uid: f0cf665b-76b8-4e11-9c15-5045206fac00
spec:
  logLevel: abc
  managementState: Managed
  operatorLogLevel: abbc

Moving to VERIFIED

Client Version: openshift-clients-4.6.0-202006250705.p0-162-g074039a0a
Server Version: 4.6.0-0.nightly-2020-10-09-153352
Kubernetes Version: v1.19.0+d59ce34

Comment 9 errata-xmlrpc 2020-10-27 16:46:29 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.

https://access.redhat.com/errata/RHBA-2020:4196