Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 80 additions & 1 deletion openapi/generated_openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -20832,6 +20832,32 @@
}
}
},
"com.github.openshift.api.operator.v1.CSIDriverConfigSpec": {
"description": "CSIDriverConfigSpec defines configuration spec that can be used to optionally configure a specific CSI Driver.",
"type": "object",
"required": [
"driverType"
],
"properties": {
"driverType": {
"description": "driverType indicates type of CSI driver for which the driverConfig is being applied to.\n\nValid values are:\n\n* vSphere\n\nAllows configuration of vsphere CSI driver topology.",
"type": "string",
"default": ""
},
"vSphere": {
"description": "vsphere is used to configure the vsphere CSI driver.",
"$ref": "#/definitions/com.github.openshift.api.operator.v1.VSphereCSIDriverConfigSpec"
}
},
"x-kubernetes-unions": [
{
"discriminator": "driverType",
"fields-to-discriminateBy": {
"vSphere": "VSphere"
}
}
]
},
"com.github.openshift.api.operator.v1.CSISnapshotController": {
"description": "CSISnapshotController provides a means to configure an operator to manage the CSI snapshots. `cluster` is the canonical name.\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).",
"type": "object",
Expand Down Expand Up @@ -21192,6 +21218,11 @@
"managementState"
],
"properties": {
"driverConfig": {
"description": "driverConfig can be used to specify platform specific driver configuration. When omitted, this means no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time.",
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.CSIDriverConfigSpec"
},
"logLevel": {
"description": "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.\n\nValid values are: \"Normal\", \"Debug\", \"Trace\", \"TraceAll\". Defaults to \"Normal\".",
"type": "string"
Expand Down Expand Up @@ -25657,6 +25688,20 @@
}
}
},
"com.github.openshift.api.operator.v1.VSphereCSIDriverConfigSpec": {
"description": "VSphereCSIDriverConfigSpec defines properties that can be configured for vsphere CSI driver.",
"type": "object",
"properties": {
"topologyCategories": {
"description": "topologyCategories indicates tag categories with which vcenter resources such as hostcluster or datacenter were tagged with. If cluster Infrastructure object has a topology, values specified in Infrastructure object will be used and modifications to topologyCategories will be rejected.",
"type": "array",
"items": {
"type": "string",
"default": ""
}
}
}
},
"com.github.openshift.api.operator.v1alpha1.DelegatedAuthentication": {
"description": "DelegatedAuthentication allows authentication to be disabled.",
"type": "object",
Expand Down
32 changes: 32 additions & 0 deletions operator/v1/0000_90_cluster_csi_driver_01_config.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,38 @@ spec:
spec:
description: spec holds user settable values for configuration
properties:
driverConfig:
description: driverConfig can be used to specify platform specific
driver configuration. When omitted, this means no opinion and the
platform is left to choose reasonable defaults. These defaults are
subject to change over time.
properties:
driverType:
description: "driverType indicates type of CSI driver for which
the driverConfig is being applied to. \n Valid values are: \n
* vSphere \n Allows configuration of vsphere CSI driver topology.
\n --- Consumers should treat unknown values as a NO-OP."
enum:
- ""
- vSphere
type: string
vSphere:
description: vsphere is used to configure the vsphere CSI driver.
properties:
topologyCategories:
description: topologyCategories indicates tag categories with
which vcenter resources such as hostcluster or datacenter
were tagged with. If cluster Infrastructure object has a
topology, values specified in Infrastructure object will
be used and modifications to topologyCategories will be
rejected.
items:
type: string
type: array
type: object
required:
- driverType
type: object
logLevel:
default: Normal
description: "logLevel is an intent based logging for an overall component.
Expand Down
51 changes: 51 additions & 0 deletions operator/v1/types_csi_cluster_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,57 @@ type ClusterCSIDriverSpec struct {
// The current default behaviour is Managed.
// +optional
StorageClassState StorageClassStateName `json:"storageClassState,omitempty"`

// driverConfig can be used to specify platform specific driver configuration.
// When omitted, this means no opinion and the platform is left to choose reasonable
// defaults. These defaults are subject to change over time.
// +optional
DriverConfig CSIDriverConfigSpec `json:"driverConfig"`
}

// CSIDriverType indicates type of CSI driver being configured.
// +kubebuilder:validation:Enum="";vSphere
type CSIDriverType string

const (
VSphereDriverType CSIDriverType = "vSphere"
)

// CSIDriverConfigSpec defines configuration spec that can be
// used to optionally configure a specific CSI Driver.
// +union
type CSIDriverConfigSpec struct {
Comment thread
gnufied marked this conversation as resolved.
// driverType indicates type of CSI driver for which the
// driverConfig is being applied to.
//
// Valid values are:
//
// * vSphere
//
// Allows configuration of vsphere CSI driver topology.
//
// ---
// Consumers should treat unknown values as a NO-OP.
//
// +kubebuilder:validation:Required
// +unionDiscriminator
DriverType CSIDriverType `json:"driverType"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this enum is expected over time, you need to add a developer note to explain what consumers should do when they observe an unknown value, there's typically two options there

Suggested change
DriverType CSIDriverType `json:"driverType"`
// ---
// + Consumers should treat unknown values as a no-op || Consumers should treat unknown values as an error and stop processing.
DriverType CSIDriverType `json:"driverType"`


// vsphere is used to configure the vsphere CSI driver.
// +optional
VSphere *VSphereCSIDriverConfigSpec `json:"vSphere,omitempty"`
}

// VSphereCSIDriverConfigSpec defines properties that
// can be configured for vsphere CSI driver.
type VSphereCSIDriverConfigSpec struct {
// topologyCategories indicates tag categories with which
// vcenter resources such as hostcluster or datacenter were tagged with.
// If cluster Infrastructure object has a topology, values specified in
// Infrastructure object will be used and modifications to topologyCategories
// will be rejected.
// +optional
TopologyCategories []string `json:"topologyCategories,omitempty"`
}

// ClusterCSIDriverStatus is the observed status of CSI driver operator
Expand Down
43 changes: 43 additions & 0 deletions operator/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions operator/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.