Bug 1866262

Summary: ClusterCSIDriver CRs are not validated
Product: OpenShift Container Platform Reporter: Jan Safranek <jsafrane>
Component: StorageAssignee: Jan Safranek <jsafrane>
Storage sub component: Operators QA Contact: Qin Ping <piqin>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: aos-bugs
Version: 4.6   
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: Environment:
Last Closed: 2020-10-27 16:24:53 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 Jan Safranek 2020-08-05 08:56:02 UTC
Users can create invalid ClusterCSIDriver instances:

apiVersion: operator.openshift.io/v1
kind: ClusterCSIDriver
metadata:
    name: manila.csi.openstack.org
  spec:
    driverConfig:
      driverName: ebs.csi.aws.com
    logLevel: Normal
    managementState: Managed
    operatorLogLevel: Normal

Note that the CR name does not correspond to `spec.driverConfig.driverName`.

CSO will always create valid instances, however, we should block users from breaking them via validation.

Comment 1 Jan Safranek 2020-08-07 15:46:05 UTC
We'll going to fix it by validation in the operators, not by webhook. I.e. the operator sets a condition (Degraded?) that the CR is not valid and refuse to operate on it.

Comment 2 Jan Safranek 2020-08-17 09:51:03 UTC
It would be even better to remove ClusterCSIDriver.Spec.DriverConfig, as it does not bring anything useful (yet). We may always introduce it later.

Comment 3 Jan Safranek 2020-08-17 09:51:31 UTC
Attempt to remove ClusterCSIDriver.Spec.DriverConfig: https://github.com/openshift/api/pull/718

Comment 6 Qin Ping 2020-08-19 07:12:25 UTC
The fixed is not included in 4.6.0-0.nightly-2020-08-18-165040, waiting for a new version.

Comment 7 Qin Ping 2020-08-21 06:03:11 UTC
verified with: 4.6.0-0.nightly-2020-08-20-234448

Comment 9 errata-xmlrpc 2020-10-27 16:24:53 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