@@ -408,6 +408,21 @@ func GetCSIDeploymentYAML(args *DeploymentYAMLArguments) string {
408408 args .ImageRegistry = commonconfig .KubernetesCSISidecarRegistry
409409 }
410410
411+ sidecarImages := []struct {
412+ arg * string
413+ tag string
414+ }{
415+ {& args .CSISidecarProvisionerImage , commonconfig .CSISidecarProvisionerImageTag },
416+ {& args .CSISidecarAttacherImage , commonconfig .CSISidecarAttacherImageTag },
417+ {& args .CSISidecarResizerImage , commonconfig .CSISidecarResizerImageTag },
418+ {& args .CSISidecarSnapshotterImage , commonconfig .CSISidecarSnapshotterImageTag },
419+ }
420+ for _ , image := range sidecarImages {
421+ if * image .arg == "" {
422+ * image .arg = args .ImageRegistry + "/" + image .tag
423+ }
424+ }
425+
411426 if args .AutosupportImage == "" {
412427 args .AutosupportImage = commonconfig .DefaultAutosupportImage
413428 }
@@ -477,7 +492,10 @@ func GetCSIDeploymentYAML(args *DeploymentYAMLArguments) string {
477492
478493 deploymentYAML = strings .ReplaceAll (deploymentYAML , "{TRIDENT_IMAGE}" , args .TridentImage )
479494 deploymentYAML = strings .ReplaceAll (deploymentYAML , "{DEPLOYMENT_NAME}" , args .DeploymentName )
480- deploymentYAML = strings .ReplaceAll (deploymentYAML , "{CSI_SIDECAR_REGISTRY}" , args .ImageRegistry )
495+ deploymentYAML = strings .ReplaceAll (deploymentYAML , "{CSI_SIDECAR_PROVISIONER_IMAGE}" , args .CSISidecarProvisionerImage )
496+ deploymentYAML = strings .ReplaceAll (deploymentYAML , "{CSI_SIDECAR_ATTACHER_IMAGE}" , args .CSISidecarAttacherImage )
497+ deploymentYAML = strings .ReplaceAll (deploymentYAML , "{CSI_SIDECAR_RESIZER_IMAGE}" , args .CSISidecarResizerImage )
498+ deploymentYAML = strings .ReplaceAll (deploymentYAML , "{CSI_SIDECAR_SNAPSHOTTER_IMAGE}" , args .CSISidecarSnapshotterImage )
481499 deploymentYAML = strings .ReplaceAll (deploymentYAML , "{LABEL_APP}" , args .Labels [TridentAppLabelKey ])
482500 deploymentYAML = strings .ReplaceAll (deploymentYAML , "{SIDECAR_LOG_LEVEL}" , sideCarLogLevel )
483501 deploymentYAML = strings .ReplaceAll (deploymentYAML , "{LOG_FORMAT}" , args .LogFormat )
@@ -633,7 +651,7 @@ spec:
633651 - name: asup-dir
634652 mountPath: /asup
635653 - name: csi-provisioner
636- image: {CSI_SIDECAR_REGISTRY}/csi-provisioner:v5.2.0
654+ image: {CSI_SIDECAR_PROVISIONER_IMAGE}
637655 imagePullPolicy: {IMAGE_PULL_POLICY}
638656 securityContext:
639657 capabilities:
@@ -653,7 +671,7 @@ spec:
653671 - name: socket-dir
654672 mountPath: /var/lib/csi/sockets/pluginproxy/
655673 - name: csi-attacher
656- image: {CSI_SIDECAR_REGISTRY}/csi-attacher:v4.8.0
674+ image: {CSI_SIDECAR_ATTACHER_IMAGE}
657675 imagePullPolicy: {IMAGE_PULL_POLICY}
658676 securityContext:
659677 capabilities:
@@ -672,8 +690,12 @@ spec:
672690 - name: socket-dir
673691 mountPath: /var/lib/csi/sockets/pluginproxy/
674692 - name: csi-resizer
675- image: {CSI_SIDECAR_REGISTRY}/csi-resizer:v1.13.1
693+ image: {CSI_SIDECAR_RESIZER_IMAGE}
676694 imagePullPolicy: {IMAGE_PULL_POLICY}
695+ securityContext:
696+ capabilities:
697+ drop:
698+ - all
677699 args:
678700 - "--v={SIDECAR_LOG_LEVEL}"
679701 - "--timeout=300s"
@@ -686,7 +708,7 @@ spec:
686708 - name: socket-dir
687709 mountPath: /var/lib/csi/sockets/pluginproxy/
688710 - name: csi-snapshotter
689- image: {CSI_SIDECAR_REGISTRY}/csi-snapshotter:v8.2.0
711+ image: {CSI_SIDECAR_SNAPSHOTTER_IMAGE}
690712 imagePullPolicy: {IMAGE_PULL_POLICY}
691713 securityContext:
692714 capabilities:
@@ -771,10 +793,6 @@ func GetCSIDaemonSetYAMLWindows(args *DaemonsetYAMLArguments) string {
771793 daemonSetYAML = daemonSet120YAMLTemplateWindows
772794 }
773795
774- if args .ImageRegistry == "" {
775- args .ImageRegistry = commonconfig .KubernetesCSISidecarRegistry
776- }
777-
778796 if args .Labels == nil {
779797 args .Labels = map [string ]string {}
780798 }
@@ -788,10 +806,28 @@ func GetCSIDaemonSetYAMLWindows(args *DaemonsetYAMLArguments) string {
788806 }
789807 }
790808
809+ if args .ImageRegistry == "" {
810+ args .ImageRegistry = commonconfig .KubernetesCSISidecarRegistry
811+ }
812+
813+ sidecarImages := []struct {
814+ arg * string
815+ tag string
816+ }{
817+ {& args .CSISidecarNodeDriverRegistrarImage , commonconfig .CSISidecarNodeDriverRegistrarImageTag },
818+ {& args .CSISidecarLivenessProbeImage , commonconfig .CSISidecarLivenessProbeImageTag },
819+ }
820+ for _ , image := range sidecarImages {
821+ if * image .arg == "" {
822+ * image .arg = args .ImageRegistry + "/" + image .tag
823+ }
824+ }
825+
791826 kubeletDir := strings .TrimRight (args .KubeletDir , "/" )
792827 daemonSetYAML = strings .ReplaceAll (daemonSetYAML , "{TRIDENT_IMAGE}" , args .TridentImage )
793828 daemonSetYAML = strings .ReplaceAll (daemonSetYAML , "{DAEMONSET_NAME}" , args .DaemonsetName )
794- daemonSetYAML = strings .ReplaceAll (daemonSetYAML , "{CSI_SIDECAR_REGISTRY}" , args .ImageRegistry )
829+ daemonSetYAML = strings .ReplaceAll (daemonSetYAML , "{CSI_SIDECAR_NODE_DRIVER_REGISTRAR_IMAGE}" , args .CSISidecarNodeDriverRegistrarImage )
830+ daemonSetYAML = strings .ReplaceAll (daemonSetYAML , "{CSI_SIDECAR_LIVENESS_PROBE_IMAGE}" , args .CSISidecarLivenessProbeImage )
795831 daemonSetYAML = strings .ReplaceAll (daemonSetYAML , "{KUBELET_DIR}" , kubeletDir )
796832 daemonSetYAML = strings .ReplaceAll (daemonSetYAML , "{LABEL_APP}" , args .Labels [TridentAppLabelKey ])
797833 daemonSetYAML = strings .ReplaceAll (daemonSetYAML , "{SIDECAR_LOG_LEVEL}" , sidecarLogLevel )
@@ -844,10 +880,6 @@ func GetCSIDaemonSetYAMLLinux(args *DaemonsetYAMLArguments) string {
844880
845881 daemonSetYAML := daemonSet120YAMLTemplateLinux
846882
847- if args .ImageRegistry == "" {
848- args .ImageRegistry = commonconfig .KubernetesCSISidecarRegistry
849- }
850-
851883 if args .Labels == nil {
852884 args .Labels = map [string ]string {}
853885 }
@@ -861,12 +893,21 @@ func GetCSIDaemonSetYAMLLinux(args *DaemonsetYAMLArguments) string {
861893 }
862894 }
863895
896+ if args .ImageRegistry == "" {
897+ args .ImageRegistry = commonconfig .KubernetesCSISidecarRegistry
898+ }
899+
900+ if args .CSISidecarNodeDriverRegistrarImage == "" {
901+ args .CSISidecarNodeDriverRegistrarImage = args .ImageRegistry + "/" + commonconfig .CSISidecarNodeDriverRegistrarImageTag
902+ }
903+
864904 kubeletDir := strings .TrimRight (args .KubeletDir , "/" )
865905 // NodePrep this must come first because it adds a section that has tags in it
866906 daemonSetYAML = replaceNodePrepTag (daemonSetYAML , args .NodePrep )
867907 daemonSetYAML = strings .ReplaceAll (daemonSetYAML , "{TRIDENT_IMAGE}" , args .TridentImage )
868908 daemonSetYAML = strings .ReplaceAll (daemonSetYAML , "{DAEMONSET_NAME}" , args .DaemonsetName )
869- daemonSetYAML = strings .ReplaceAll (daemonSetYAML , "{CSI_SIDECAR_REGISTRY}" , args .ImageRegistry )
909+ daemonSetYAML = strings .ReplaceAll (daemonSetYAML , "{CSI_SIDECAR_NODE_DRIVER_REGISTRAR_IMAGE}" ,
910+ args .CSISidecarNodeDriverRegistrarImage )
870911 daemonSetYAML = strings .ReplaceAll (daemonSetYAML , "{KUBELET_DIR}" , kubeletDir )
871912 daemonSetYAML = strings .ReplaceAll (daemonSetYAML , "{LABEL_APP}" , args .Labels [TridentAppLabelKey ])
872913 daemonSetYAML = strings .ReplaceAll (daemonSetYAML , "{FORCE_DETACH_BOOL}" , strconv .FormatBool (args .EnableForceDetach ))
@@ -1069,7 +1110,7 @@ spec:
10691110 mountPath: /certs
10701111 readOnly: true
10711112 - name: driver-registrar
1072- image: {CSI_SIDECAR_REGISTRY}/csi-node-driver-registrar:v2.13.0
1113+ image: {CSI_SIDECAR_NODE_DRIVER_REGISTRAR_IMAGE}
10731114 imagePullPolicy: {IMAGE_PULL_POLICY}
10741115 args:
10751116 - "--v={SIDECAR_LOG_LEVEL}"
@@ -1273,7 +1314,7 @@ spec:
12731314 cpu: 10m
12741315 memory: 20Mi
12751316 - name: node-driver-registrar
1276- image: {CSI_SIDECAR_REGISTRY}/csi-node-driver-registrar:v2.10.0
1317+ image: {CSI_SIDECAR_NODE_DRIVER_REGISTRAR_IMAGE}
12771318 imagePullPolicy: {IMAGE_PULL_POLICY}
12781319 args:
12791320 - --v=2
@@ -1313,7 +1354,7 @@ spec:
13131354 volumeMounts:
13141355 - mountPath: C:\csi
13151356 name: plugin-dir
1316- image: {CSI_SIDECAR_REGISTRY}/livenessprobe:v2.5.0
1357+ image: {CSI_SIDECAR_LIVENESS_PROBE_IMAGE}
13171358 args:
13181359 - --csi-address=$(CSI_ENDPOINT)
13191360 - --probe-timeout=3s
0 commit comments