Skip to content

Commit

Permalink
Use default sleep time for Azure File PVC if the annotation value is …
Browse files Browse the repository at this point in the history
…set to 0

* Bump plugin tag to v0.5.1.4
  • Loading branch information
0x113 committed Nov 23, 2023
1 parent 77c2209 commit 95e9558
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BUILD_IMAGE ?= golang:1.20.6-bullseye

REGISTRY ?= catalogicsoftware
IMAGE_NAME ?= $(REGISTRY)/velero-plugin-for-csi
TAG ?= v0.5.1.3
TAG ?= v0.5.1.4

IMAGE ?= $(IMAGE_NAME):$(TAG)

Expand Down
17 changes: 12 additions & 5 deletions internal/restore/pvc_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,18 @@ func ProcessAzureRestore(pvc *corev1api.PersistentVolumeClaim, volumeSnapshotNam
pvcRestoreWaitTimeStr, CCAzureFilesPvcRestoreWaitTimeAnnotation, err, DefaultAzureFilesSleepDuration,
)
} else {
log.Infof(
"Value of %q annotation is set to %v. Using this value as the sleep time before returning from restore PVC action plugin",
CCAzureFilesPvcRestoreWaitTimeAnnotation, pvcRestoreWaitTimeSec,
)
pvcRestoreWaitTime = time.Duration(pvcRestoreWaitTimeSec) * time.Second
if pvcRestoreWaitTimeSec == 0 {
log.Infof(
"Value of %q annotation is set to 0. Using default value: %v",
CCAzureFilesPvcRestoreWaitTimeAnnotation, DefaultAzureFilesSleepDuration,
)
} else {
log.Infof(
"Value of %q annotation is set to %v. Using this value as the sleep time before returning from restore PVC action plugin",
CCAzureFilesPvcRestoreWaitTimeAnnotation, pvcRestoreWaitTimeSec,
)
pvcRestoreWaitTime = time.Duration(pvcRestoreWaitTimeSec) * time.Second
}
}
}

Expand Down

0 comments on commit 95e9558

Please sign in to comment.