From e0413c1306eb76b3e91a717891e4479175970190 Mon Sep 17 00:00:00 2001 From: Nikita Bhatia Date: Thu, 17 Aug 2023 15:33:50 +0530 Subject: [PATCH 1/5] Update yaml tag for csiWindowsDriver to match with spec generator --- drivers/storage/portworx/component/windows.go | 4 ++-- drivers/storage/portworx/manifest/manifest.go | 4 ++-- drivers/storage/portworx/portworx.go | 2 +- drivers/storage/portworx/portworx_test.go | 8 ++++---- drivers/storage/portworx/testspec/px-csi-node-win.yaml | 2 +- drivers/storage/portworx/testspec/px-csi-win-driver.yaml | 2 +- drivers/storage/portworx/util/csi_generator.go | 4 ++-- pkg/apis/core/v1/storagecluster.go | 2 +- pkg/migration/generate.go | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/storage/portworx/component/windows.go b/drivers/storage/portworx/component/windows.go index 5073f952ab..41957f797e 100644 --- a/drivers/storage/portworx/component/windows.go +++ b/drivers/storage/portworx/component/windows.go @@ -222,8 +222,8 @@ func (w *windows) getDesiredLivenessImage(cluster *corev1.StorageCluster) string func (w *windows) getDesiredInstallerImage(cluster *corev1.StorageCluster) string { var imageName string - if cluster.Status.DesiredImages != nil && cluster.Status.DesiredImages.CsiWinDriver != "" { - imageName = cluster.Status.DesiredImages.CsiWinDriver + if cluster.Status.DesiredImages != nil && cluster.Status.DesiredImages.CsiWindowsDriver != "" { + imageName = cluster.Status.DesiredImages.CsiWindowsDriver } imageName = util.GetImageURN(cluster, imageName) return imageName diff --git a/drivers/storage/portworx/manifest/manifest.go b/drivers/storage/portworx/manifest/manifest.go index 8659d15d88..daff0c81fe 100644 --- a/drivers/storage/portworx/manifest/manifest.go +++ b/drivers/storage/portworx/manifest/manifest.go @@ -92,7 +92,7 @@ type Release struct { DynamicPlugin string `yaml:"dynamicPlugin,omitempty"` DynamicPluginProxy string `yaml:"dynamicPluginProxy,omitempty"` CsiLivenessProbe string `yaml:"csiLivenessProbe,omitempty"` - CsiWinDriver string `yaml:"csiWinDriver,omitempty"` + CsiWindowsDriver string `yaml:"csiWindowsDriver,omitempty"` } // Version is the response structure from a versions source @@ -285,7 +285,7 @@ func fillCSIDefaults( rel.Components.CSISnapshotController = csiImages.SnapshotController rel.Components.CSIHealthMonitorController = csiImages.HealthMonitorController rel.Components.CsiLivenessProbe = csiImages.LivenessProbe - rel.Components.CsiWinDriver = csiImages.CsiDriverInstaller + rel.Components.CsiWindowsDriver = csiImages.CsiDriverInstaller } func fillPrometheusDefaults( diff --git a/drivers/storage/portworx/portworx.go b/drivers/storage/portworx/portworx.go index 2b9f071373..d3327e17b4 100644 --- a/drivers/storage/portworx/portworx.go +++ b/drivers/storage/portworx/portworx.go @@ -395,7 +395,7 @@ func (p *portworx) SetDefaultsOnStorageCluster(toUpdate *corev1.StorageCluster) toUpdate.Status.DesiredImages.CSISnapshotter = release.Components.CSISnapshotter toUpdate.Status.DesiredImages.CSIHealthMonitorController = release.Components.CSIHealthMonitorController toUpdate.Status.DesiredImages.CsiLivenessProbe = release.Components.CsiLivenessProbe - toUpdate.Status.DesiredImages.CsiWinDriver = release.Components.CsiWinDriver + toUpdate.Status.DesiredImages.CsiWindowsDriver = release.Components.CsiWindowsDriver } if autoUpdateCSISnapshotController(toUpdate) && (toUpdate.Status.DesiredImages.CSISnapshotController == "" || diff --git a/drivers/storage/portworx/portworx_test.go b/drivers/storage/portworx/portworx_test.go index f357554625..79f8870a62 100644 --- a/drivers/storage/portworx/portworx_test.go +++ b/drivers/storage/portworx/portworx_test.go @@ -2191,8 +2191,8 @@ func TestStorageClusterDefaultsForWindows(t *testing.T) { err := driver.SetDefaultsOnStorageCluster(cluster) require.NoError(t, err) - require.Equal(t, cluster.Status.DesiredImages.CsiWinDriver, "docker.io/portworx/pxwincsidriver:v0.1") - require.Equal(t, cluster.Status.DesiredImages.CsiLivenessProbe, "registry.k8s.io/sig-storage/livenessprobe:v2.7.0") + require.Equal(t, cluster.Status.DesiredImages.CsiWindowsDriver, "docker.io/portworx/px-windows-csi-driver:v0.1") + require.Equal(t, cluster.Status.DesiredImages.CsiLivenessProbe, "registry.k8s.io/sig-storage/livenessprobe:v2.10.0") require.Equal(t, cluster.Status.DesiredImages.CSIDriverRegistrar, "quay.io/k8scsi/driver-registrar:v1.2.3") } @@ -8554,8 +8554,8 @@ func (m *fakeManifest) GetVersions( TelemetryProxy: "purestorage/envoy:1.2.3", DynamicPlugin: "portworx/portworx-dynamic-plugin:1.1.0", DynamicPluginProxy: "nginxinc/nginx-unprivileged:1.23", - CsiLivenessProbe: "registry.k8s.io/sig-storage/livenessprobe:v2.7.0", - CsiWinDriver: "docker.io/portworx/pxwincsidriver:v0.1", + CsiLivenessProbe: "registry.k8s.io/sig-storage/livenessprobe:v2.10.0", + CsiWindowsDriver: "docker.io/portworx/px-windows-csi-driver:v0.1", }, } if m.k8sVersion != nil && m.k8sVersion.GreaterThanOrEqual(k8sutil.K8sVer1_22) { diff --git a/drivers/storage/portworx/testspec/px-csi-node-win.yaml b/drivers/storage/portworx/testspec/px-csi-node-win.yaml index f61053ee7e..049b04972c 100644 --- a/drivers/storage/portworx/testspec/px-csi-node-win.yaml +++ b/drivers/storage/portworx/testspec/px-csi-node-win.yaml @@ -25,7 +25,7 @@ spec: value: 'unix://C:\\csi\\csi.sock' imagePullPolicy: IfNotPresent name: liveness-probe - image: registry.k8s.io/sig-storage/livenessprobe:v2.7.0 + image: registry.k8s.io/sig-storage/livenessprobe:v2.10.0 resources: limits: memory: 100Mi diff --git a/drivers/storage/portworx/testspec/px-csi-win-driver.yaml b/drivers/storage/portworx/testspec/px-csi-win-driver.yaml index 0e5af13e6c..9991519520 100644 --- a/drivers/storage/portworx/testspec/px-csi-win-driver.yaml +++ b/drivers/storage/portworx/testspec/px-csi-win-driver.yaml @@ -16,7 +16,7 @@ spec: serviceAccountName: portworx containers: - name: windowsinstaller - image: docker.io/portworx/pxwincsidriver:v0.1 + image: docker.io/portworx/px-windows-csi-driver:v0.1 imagePullPolicy: Always securityContext: windowsOptions: diff --git a/drivers/storage/portworx/util/csi_generator.go b/drivers/storage/portworx/util/csi_generator.go index db9c4db018..41aefa9ba4 100644 --- a/drivers/storage/portworx/util/csi_generator.go +++ b/drivers/storage/portworx/util/csi_generator.go @@ -296,8 +296,8 @@ func (g *CSIGenerator) getSidecarContainerVersionsV1_0() *CSIImages { Resizer: k8sutil.DefaultK8SRegistryPath + "/sig-storage/csi-resizer:v1.8.0", SnapshotController: snapshotControllerImage, HealthMonitorController: k8sutil.DefaultK8SRegistryPath + "/sig-storage/csi-external-health-monitor-controller:v0.7.0", - LivenessProbe: k8sutil.DefaultK8SRegistryPath + "/sig-storage/livenessprobe:v2.7.0", - CsiDriverInstaller: "docker.io/portworx/pxwincsidriver:v0.1", + LivenessProbe: k8sutil.DefaultK8SRegistryPath + "/sig-storage/livenessprobe:v2.10.0", + CsiDriverInstaller: "docker.io/portworx/px-windows-csi-driver:v0.1", } } diff --git a/pkg/apis/core/v1/storagecluster.go b/pkg/apis/core/v1/storagecluster.go index ac502b36a8..0a5e824f43 100644 --- a/pkg/apis/core/v1/storagecluster.go +++ b/pkg/apis/core/v1/storagecluster.go @@ -613,7 +613,7 @@ type ComponentImages struct { DynamicPlugin string `json:"dynamicPlugin,omitempty"` DynamicPluginProxy string `json:"dynamicPluginProxy,omitempty"` CsiLivenessProbe string `json:"csiLivenessProbe,omitempty"` - CsiWinDriver string `json:"csiWinDriver,omitempty"` + CsiWindowsDriver string `json:"csiWindowsDriver,omitempty"` } // Storage represents cluster storage details diff --git a/pkg/migration/generate.go b/pkg/migration/generate.go index 2a03a7987d..b897052d72 100644 --- a/pkg/migration/generate.go +++ b/pkg/migration/generate.go @@ -1276,7 +1276,7 @@ func (h *Handler) handleCustomImageRegistry(cluster *corev1.StorageCluster) erro DynamicPlugin: h.removeCustomImageRegistry(cluster.Spec.CustomImageRegistry, cluster.Status.DesiredImages.DynamicPlugin), DynamicPluginProxy: h.removeCustomImageRegistry(cluster.Spec.CustomImageRegistry, cluster.Status.DesiredImages.DynamicPluginProxy), CsiLivenessProbe: h.removeCustomImageRegistry(cluster.Spec.CustomImageRegistry, cluster.Status.DesiredImages.CsiLivenessProbe), - CsiWinDriver: h.removeCustomImageRegistry(cluster.Spec.CustomImageRegistry, cluster.Status.DesiredImages.CsiWinDriver), + CsiWindowsDriver: h.removeCustomImageRegistry(cluster.Spec.CustomImageRegistry, cluster.Status.DesiredImages.CsiWindowsDriver), } cluster.Status.Version = pxutil.GetImageTag(cluster.Spec.Image) return nil @@ -1337,7 +1337,7 @@ func (h *Handler) createManifestConfigMap(cluster *corev1.StorageCluster) error DynamicPlugin: cluster.Status.DesiredImages.DynamicPlugin, DynamicPluginProxy: cluster.Status.DesiredImages.DynamicPluginProxy, CsiLivenessProbe: cluster.Status.DesiredImages.CsiLivenessProbe, - CsiWinDriver: cluster.Status.DesiredImages.CsiWinDriver, + CsiWindowsDriver: cluster.Status.DesiredImages.CsiWindowsDriver, }, } From 317e3debc01059570dfe0f26568d461fe9722477 Mon Sep 17 00:00:00 2001 From: Nikita Bhatia Date: Fri, 18 Aug 2023 09:55:19 +0530 Subject: [PATCH 2/5] update csiWindowsDriver tag in storagecluster crd --- deploy/crds/core_v1_storagecluster_crd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/crds/core_v1_storagecluster_crd.yaml b/deploy/crds/core_v1_storagecluster_crd.yaml index df3e007386..861f145d99 100644 --- a/deploy/crds/core_v1_storagecluster_crd.yaml +++ b/deploy/crds/core_v1_storagecluster_crd.yaml @@ -3828,7 +3828,7 @@ spec: csiLivenessProbe: type: string description: Desired image for Liveness probe. - csiDriverWin: + csiWindowsDriver: type: string description: Desired image for csi driver for windows. csiDriverRegistrar: From 23d650dd191ee723f4face39ea5a74628b01241c Mon Sep 17 00:00:00 2001 From: Nikita Bhatia Date: Fri, 18 Aug 2023 11:07:52 +0530 Subject: [PATCH 3/5] correct nodeaffinity format --- ...tworx-certified.clusterserviceversion.yaml | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/deploy/olm-catalog/portworx/23.7.1/portworx-certified.clusterserviceversion.yaml b/deploy/olm-catalog/portworx/23.7.1/portworx-certified.clusterserviceversion.yaml index 9084cf0989..6cec0c193c 100644 --- a/deploy/olm-catalog/portworx/23.7.1/portworx-certified.clusterserviceversion.yaml +++ b/deploy/olm-catalog/portworx/23.7.1/portworx-certified.clusterserviceversion.yaml @@ -210,21 +210,21 @@ spec: affinity: podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: name - operator: In - values: - - portworx-operator - topologyKey: kubernetes.io/hostname + - labelSelector: + matchExpressions: + - key: name + operator: In + values: + - portworx-operator + topologyKey: kubernetes.io/hostname nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: kubernetes.io/os - operator: In - values: - - linux + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/os + operator: In + values: + - linux containers: - name: portworx-operator image: docker.io/portworx/px-operator:23.7.1-dev From 600c60ef5307aac7bced96c6eee18ee0a2a3cbfc Mon Sep 17 00:00:00 2001 From: Nikita Bhatia Date: Fri, 18 Aug 2023 12:49:22 +0530 Subject: [PATCH 4/5] rename toleration from windows to Windows --- deploy/windows/px-csi-node-win.yaml | 12 ------------ drivers/storage/portworx/util/util.go | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/deploy/windows/px-csi-node-win.yaml b/deploy/windows/px-csi-node-win.yaml index a34d4a1d1c..8fa9c8c18a 100644 --- a/deploy/windows/px-csi-node-win.yaml +++ b/deploy/windows/px-csi-node-win.yaml @@ -79,23 +79,11 @@ spec: name: registration-dir dnsPolicy: ClusterFirst hostNetwork: true - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/os - operator: In - values: - - windows priorityClassName: system-node-critical restartPolicy: Always schedulerName: default-scheduler securityContext: {} terminationGracePeriodSeconds: 30 - tolerations: - - key: os - value: Windows volumes: - hostPath: path: 'C:\var\lib\kubelet\plugins_registry\' diff --git a/drivers/storage/portworx/util/util.go b/drivers/storage/portworx/util/util.go index c6796e3cb0..608685f8eb 100644 --- a/drivers/storage/portworx/util/util.go +++ b/drivers/storage/portworx/util/util.go @@ -1033,7 +1033,7 @@ func ApplyWindowsSettingsToPodSpec(podSpec *v1.PodSpec) { toleration := v1.Toleration{ Key: "os", - Value: WindowsOsName, + Value: "Windows", } podSpec.Tolerations = append(podSpec.Tolerations, toleration) From 7793427931ac77972f4ab26ab0406dee3a94b691 Mon Sep 17 00:00:00 2001 From: Nikita Bhatia Date: Fri, 18 Aug 2023 13:18:05 +0530 Subject: [PATCH 5/5] build fix --- drivers/storage/portworx/testspec/px-csi-node-win.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/storage/portworx/testspec/px-csi-node-win.yaml b/drivers/storage/portworx/testspec/px-csi-node-win.yaml index 049b04972c..9a17995a9b 100644 --- a/drivers/storage/portworx/testspec/px-csi-node-win.yaml +++ b/drivers/storage/portworx/testspec/px-csi-node-win.yaml @@ -67,7 +67,6 @@ spec: timeoutSeconds: 30 name: node-driver-registrar image: quay.io/k8scsi/csi-node-driver-registrar:v1.2.3 - resources: limits: memory: 100Mi @@ -99,9 +98,6 @@ spec: schedulerName: default-scheduler securityContext: {} terminationGracePeriodSeconds: 30 - tolerations: - - key: os - value: Windows volumes: - hostPath: path: 'C:\var\lib\kubelet\plugins_registry\'