Skip to content

Commit

Permalink
Merge pull request #829 from andyzhangx/upgrade-csi-provisioner-v5.0.2
Browse files Browse the repository at this point in the history
fix: upgrade csi-provisioner to v5.0.2 on v1.15.0 chart
  • Loading branch information
andyzhangx authored Aug 29, 2024
2 parents 662c7f0 + 243f36f commit 4d10e97
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
Binary file modified charts/v1.15.0/csi-driver-smb-v1.15.0.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion charts/v1.15.0/csi-driver-smb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ image:
pullPolicy: IfNotPresent
csiProvisioner:
repository: /csi-provisioner
tag: v5.0.1
tag: v5.0.2
pullPolicy: IfNotPresent
livenessProbe:
repository: /livenessprobe
Expand Down
2 changes: 2 additions & 0 deletions cmd/smbplugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var (
krb5CacheDirectory = flag.String("krb5-cache-directory", smb.DefaultKrb5CacheDirectory, "The directory for kerberos cache")
krb5Prefix = flag.String("krb5-prefix", smb.DefaultKrb5CCName, "The prefix for kerberos cache")
defaultOnDeletePolicy = flag.String("default-ondelete-policy", "", "default policy for deleting subdirectory when deleting a volume")
removeArchivedVolumePath = flag.Bool("remove-archived-volume-path", true, "remove archived volume path in DeleteVolume")
)

func main() {
Expand Down Expand Up @@ -75,6 +76,7 @@ func handle() {
DriverName: *driverName,
EnableGetVolumeStats: *enableGetVolumeStats,
RemoveSMBMappingDuringUnmount: *removeSMBMappingDuringUnmount,
RemoveArchivedVolumePath: *removeArchivedVolumePath,
WorkingMountDir: *workingMountDir,
VolStatsCacheExpireInMinutes: *volStatsCacheExpireInMinutes,
Krb5CacheDirectory: *krb5CacheDirectory,
Expand Down
2 changes: 1 addition & 1 deletion deploy/v1.15.0/csi-smb-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
effect: "NoSchedule"
containers:
- name: csi-provisioner
image: registry.k8s.io/sig-storage/csi-provisioner:v5.0.1
image: registry.k8s.io/sig-storage/csi-provisioner:v5.0.2
args:
- "-v=2"
- "--csi-address=$(ADDRESS)"
Expand Down
8 changes: 6 additions & 2 deletions pkg/smb/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,12 @@ func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest)

// archive subdirectory under base-dir. Remove stale archived copy if exists.
klog.V(2).Infof("archiving subdirectory %s --> %s", internalVolumePath, archivedInternalVolumePath)
if err = os.RemoveAll(archivedInternalVolumePath); err != nil {
return nil, status.Errorf(codes.Internal, "failed to delete archived subdirectory %s: %v", archivedInternalVolumePath, err.Error())
if d.removeArchivedVolumePath {
klog.V(2).Infof("removing archived subdirectory at %v", archivedInternalVolumePath)
if err = os.RemoveAll(archivedInternalVolumePath); err != nil {
return nil, status.Errorf(codes.Internal, "failed to delete archived subdirectory %s: %v", archivedInternalVolumePath, err.Error())
}
klog.V(2).Infof("removed archived subdirectory at %v", archivedInternalVolumePath)
}
if err = os.Rename(internalVolumePath, archivedInternalVolumePath); err != nil {
return nil, status.Errorf(codes.Internal, "archive subdirectory(%s, %s) failed with %v", internalVolumePath, archivedInternalVolumePath, err.Error())
Expand Down
3 changes: 3 additions & 0 deletions pkg/smb/smb.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ type DriverOptions struct {
Krb5CacheDirectory string
Krb5Prefix string
DefaultOnDeletePolicy string
RemoveArchivedVolumePath bool
}

// Driver implements all interfaces of CSI drivers
Expand All @@ -86,6 +87,7 @@ type Driver struct {
krb5CacheDirectory string
krb5Prefix string
defaultOnDeletePolicy string
removeArchivedVolumePath bool
}

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

Expand Down

0 comments on commit 4d10e97

Please sign in to comment.