Hide Forgot
Description of problem: Console operator panics after setting console plugin that does not exists to the console-operator config. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Go to `/k8s/cluster/operator.openshift.io~v1~Console/cluster/yaml` and add to the `spec.plugins` list `missing-plugin` entry, eg. ``` spec: logLevel: Normal managementState: Managed operatorLogLevel: Normal plugins: - missing-plugin ``` 2. Go to console-operator pod's log Actual results: Panic in to logs: ``` E0119 10:54:21.624187 1 sync_v400.go:513] failed to set service endpoint for "missing-plugin" plugin: consoleplugin.console.openshift.io "missing-plugin" not found E0119 10:54:21.624790 1 runtime.go:78] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference) goroutine 697 [running]: k8s.io/apimachinery/pkg/util/runtime.logPanic(0x20a9cc0, 0x36cd830) /go/src/github.com/openshift/console-operator/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:74 +0x95 k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0) /go/src/github.com/openshift/console-operator/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:48 +0x89 panic(0x20a9cc0, 0x36cd830) /usr/lib/golang/src/runtime/panic.go:969 +0x1b9 github.com/openshift/console-operator/pkg/console/operator.getServiceHostname(0x0, 0xc000000002, 0x0) /go/src/github.com/openshift/console-operator/pkg/console/operator/sync_v400.go:523 +0x49 github.com/openshift/console-operator/pkg/console/operator.(*consoleOperator).GetPluginsEndpointMap(0xc00017ab40, 0xc0019330d0, 0x1, 0x1, 0x7) ... ``` Expected results: Panic should not occur. If the ConsolePlugins is missing on the cluster, it should be logged in the console-operator logs, and that plugin should not be added to the map of enabled console plugins in the `console-config` ConfigMap in the openshift-console namespace. Additional info:
1. patch console.operator/cluster with non-existing plugin name $ oc get console.operator cluster -o json | jq '.spec.plugins' [ "missing-plugin" ] 2. Check console-operator pod log $ oc logs -f console-operator-6688cd6b9f-jd5bp -n openshift-console-operator stream error: stream ID 375; INTERNAL_ERROR") has prevented the request from succeeding E0122 06:19:31.268670 1 sync_v400.go:513] failed to get "missing-plugin" plugin: consoleplugin.console.openshift.io "missing-plugin" not found E0122 06:19:33.654813 1 sync_v400.go:513] failed to get "missing-plugin" plugin: consoleplugin.console.openshift.io "missing-plugin" not found Verified on 4.7.0-0.nightly-2021-01-21-215614
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.7.0 security, bug fix, and enhancement 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-2020:5633