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

PWX-33087 : CsiWindowsDriver image is not populating is storagecluster desired images #1219

Merged
merged 7 commits into from
Aug 22, 2023
2 changes: 1 addition & 1 deletion deploy/crds/core_v1_storagecluster_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions deploy/windows/px-csi-node-win.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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\'
Expand Down
4 changes: 2 additions & 2 deletions drivers/storage/portworx/component/windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,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
Expand Down
4 changes: 2 additions & 2 deletions drivers/storage/portworx/manifest/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion drivers/storage/portworx/portworx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" ||
Expand Down
8 changes: 4 additions & 4 deletions drivers/storage/portworx/portworx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

}
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 1 addition & 5 deletions drivers/storage/portworx/testspec/px-csi-node-win.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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\'
Expand Down
2 changes: 1 addition & 1 deletion drivers/storage/portworx/testspec/px-csi-win-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions drivers/storage/portworx/util/csi_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/storage/portworx/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ func ApplyWindowsSettingsToPodSpec(podSpec *v1.PodSpec) {

toleration := v1.Toleration{
Key: "os",
Value: WindowsOsName,
Value: "Windows",
}

podSpec.Tolerations = append(podSpec.Tolerations, toleration)
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/core/v1/storagecluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/migration/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
},
}

Expand Down
Loading