-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support the DevicePluginCDIDevices
feature gate
#1007
base: main
Are you sure you want to change the base?
Conversation
435a38f
to
0b0151d
Compare
DevicePluginCDIDevices
featureDevicePluginCDIDevices
feature gate
@@ -148,6 +148,9 @@ type OperatorSpec struct { | |||
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="On OpenShift, enable DriverToolkit image to build and install driver modules" | |||
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch" | |||
UseOpenShiftDriverToolkit *bool `json:"use_ocp_driver_toolkit,omitempty"` | |||
|
|||
// UseDevicePluginCDIDevicesFeature indicates if the device plug-in should be configured to use the CDI devices feature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question on the UX for this: Should this be under the cdi
object in the cluster policy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an option that only affects the operator, but is related to CDI. I don't know to which it binds more strongly. So I picked one. It's easy enough to change that in the PR, but of course hard after. Maybe other folks can chime in. Ultimately I will defer to you and your team.
setContainerEnv(&(obj.Spec.Template.Spec.Containers[0]), DeviceListStrategyEnvName, "cdi-cri") | ||
} else { | ||
setContainerEnv(&(obj.Spec.Template.Spec.Containers[0]), DeviceListStrategyEnvName, "envvar,cdi-annotations") | ||
} | ||
setContainerEnv(&(obj.Spec.Template.Spec.Containers[0]), CDIAnnotationPrefixEnvName, "nvidia.cdi.k8s.io/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block is also not relevant when using cdi-cri
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean to say that useDevicePluginCDIDevicesFeature
should be stronger than cdi.enabled
? The current design and implementation is that useDevicePluginCDIDevicesFeature
does nothing unless cdi.enabled
is set.
This patch adds support for the `DevicePluginCDIDevices` feature gate by adding `spec.operator.useDevicePluginCDIDevicesFeature` to `ClusterPolicy`. When this field is set, the operator sets the `DEVICE_LIST_STRATEGY` device plug-in environment variable to `cdi-cri`. Signed-off-by: Jean-Francois Roy <[email protected]>
0b0151d
to
ef79ad3
Compare
This patch adds support for the
DevicePluginCDIDevices
feature gate by addingspec.operator.useDevicePluginCDIDevicesFeature
toClusterPolicy
. When this field is set, the operator sets theDEVICE_LIST_STRATEGY
device plug-in environment variable tocdi-cri
.