Bug 1883692 - No validation if set invalid value to spec.logLevel and spec.operatorLogLevel in consoles.operator.openshift.io
Summary: No validation if set invalid value to spec.logLevel and spec.operatorLogLevel...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.6.0
Assignee: Jakub Hadvig
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-29 21:26 UTC by Oleg Bulatov
Modified: 2020-10-27 16:46 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1878040
Environment:
Last Closed: 2020-10-27 16:46:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift console-operator pull 473 0 None closed Bug 1877487: Bump vendor to pick fix from openshift/api 2020-10-06 13:50:41 UTC
Red Hat Product Errata RHBA-2020:4196 0 None None None 2020-10-27 16:46:51 UTC

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


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