Skip to content

Commit 243f36f

Browse files
committed
fix: upgrade csi-provisioner to v5.0.2
1 parent 662c7f0 commit 243f36f

File tree

6 files changed

+13
-4
lines changed

6 files changed

+13
-4
lines changed
2 Bytes
Binary file not shown.

charts/v1.15.0/csi-driver-smb/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ image:
66
pullPolicy: IfNotPresent
77
csiProvisioner:
88
repository: /csi-provisioner
9-
tag: v5.0.1
9+
tag: v5.0.2
1010
pullPolicy: IfNotPresent
1111
livenessProbe:
1212
repository: /livenessprobe

cmd/smbplugin/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ var (
4848
krb5CacheDirectory = flag.String("krb5-cache-directory", smb.DefaultKrb5CacheDirectory, "The directory for kerberos cache")
4949
krb5Prefix = flag.String("krb5-prefix", smb.DefaultKrb5CCName, "The prefix for kerberos cache")
5050
defaultOnDeletePolicy = flag.String("default-ondelete-policy", "", "default policy for deleting subdirectory when deleting a volume")
51+
removeArchivedVolumePath = flag.Bool("remove-archived-volume-path", true, "remove archived volume path in DeleteVolume")
5152
)
5253

5354
func main() {
@@ -75,6 +76,7 @@ func handle() {
7576
DriverName: *driverName,
7677
EnableGetVolumeStats: *enableGetVolumeStats,
7778
RemoveSMBMappingDuringUnmount: *removeSMBMappingDuringUnmount,
79+
RemoveArchivedVolumePath: *removeArchivedVolumePath,
7880
WorkingMountDir: *workingMountDir,
7981
VolStatsCacheExpireInMinutes: *volStatsCacheExpireInMinutes,
8082
Krb5CacheDirectory: *krb5CacheDirectory,

deploy/v1.15.0/csi-smb-controller.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spec:
3535
effect: "NoSchedule"
3636
containers:
3737
- name: csi-provisioner
38-
image: registry.k8s.io/sig-storage/csi-provisioner:v5.0.1
38+
image: registry.k8s.io/sig-storage/csi-provisioner:v5.0.2
3939
args:
4040
- "-v=2"
4141
- "--csi-address=$(ADDRESS)"

pkg/smb/controllerserver.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,12 @@ func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest)
191191

192192
// archive subdirectory under base-dir. Remove stale archived copy if exists.
193193
klog.V(2).Infof("archiving subdirectory %s --> %s", internalVolumePath, archivedInternalVolumePath)
194-
if err = os.RemoveAll(archivedInternalVolumePath); err != nil {
195-
return nil, status.Errorf(codes.Internal, "failed to delete archived subdirectory %s: %v", archivedInternalVolumePath, err.Error())
194+
if d.removeArchivedVolumePath {
195+
klog.V(2).Infof("removing archived subdirectory at %v", archivedInternalVolumePath)
196+
if err = os.RemoveAll(archivedInternalVolumePath); err != nil {
197+
return nil, status.Errorf(codes.Internal, "failed to delete archived subdirectory %s: %v", archivedInternalVolumePath, err.Error())
198+
}
199+
klog.V(2).Infof("removed archived subdirectory at %v", archivedInternalVolumePath)
196200
}
197201
if err = os.Rename(internalVolumePath, archivedInternalVolumePath); err != nil {
198202
return nil, status.Errorf(codes.Internal, "archive subdirectory(%s, %s) failed with %v", internalVolumePath, archivedInternalVolumePath, err.Error())

pkg/smb/smb.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ type DriverOptions struct {
6868
Krb5CacheDirectory string
6969
Krb5Prefix string
7070
DefaultOnDeletePolicy string
71+
RemoveArchivedVolumePath bool
7172
}
7273

7374
// Driver implements all interfaces of CSI drivers
@@ -86,6 +87,7 @@ type Driver struct {
8687
krb5CacheDirectory string
8788
krb5Prefix string
8889
defaultOnDeletePolicy string
90+
removeArchivedVolumePath bool
8991
}
9092

9193
// NewDriver Creates a NewCSIDriver object. Assumes vendor version is equal to driver version &
@@ -97,6 +99,7 @@ func NewDriver(options *DriverOptions) *Driver {
9799
driver.NodeID = options.NodeID
98100
driver.enableGetVolumeStats = options.EnableGetVolumeStats
99101
driver.removeSMBMappingDuringUnmount = options.RemoveSMBMappingDuringUnmount
102+
driver.removeArchivedVolumePath = options.RemoveArchivedVolumePath
100103
driver.workingMountDir = options.WorkingMountDir
101104
driver.volumeLocks = newVolumeLocks()
102105

0 commit comments

Comments
 (0)