Skip to content
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

[release-2.0] re-fixing DevicePlugin upgrade from v1.1 to v2 #969

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
3 changes: 0 additions & 3 deletions internal/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const (
TargetKernelTarget = "kmm.node.kubernetes.io/target-kernel"
KernelLabel = "kmm.node.kubernetes.io/kernel-version.full"
BuildTypeLabel = "kmm.openshift.io/build.type"
DaemonSetRole = "kmm.node.kubernetes.io/role"

WorkerPodVersionLabelPrefix = "beta.kmm.node.kubernetes.io/version-worker-pod"
DevicePluginVersionLabelPrefix = "beta.kmm.node.kubernetes.io/version-device-plugin"
Expand All @@ -23,7 +22,5 @@ const (
PublicSignDataKey = "cert"
PrivateSignDataKey = "key"

ModuleLoaderRoleLabelValue = "module-loader"

OperatorNamespaceEnvVar = "OPERATOR_NAMESPACE"
)
2 changes: 1 addition & 1 deletion internal/controllers/device_plugin_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (dprh *devicePluginReconcilerHelper) getModuleDevicePluginDaemonSets(ctx co
devicePluginsList := make([]appsv1.DaemonSet, 0, len(dsList.Items))
// remove the older version module loader daemonsets
for _, ds := range dsList.Items {
if ds.GetLabels()[constants.DaemonSetRole] != constants.ModuleLoaderRoleLabelValue {
if _, ok := ds.GetLabels()[constants.KernelLabel]; !ok {
devicePluginsList = append(devicePluginsList, ds)
}
}
Expand Down
3 changes: 1 addition & 2 deletions internal/controllers/device_plugin_reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -904,15 +904,14 @@ var _ = Describe("DevicePluginReconciler_getModuleDevicePluginDaemonSets", func(
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
constants.ModuleNameLabel: "some name",
constants.DaemonSetRole: constants.ModuleLoaderRoleLabelValue,
constants.KernelLabel: "some kernel",
},
},
}
ds3 := appsv1.DaemonSet{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
constants.ModuleNameLabel: "some name",
constants.DaemonSetRole: "some role",
},
},
}
Expand Down