From 3beb942d96866ea2b96a830da9cfceb74a2b7542 Mon Sep 17 00:00:00 2001 From: vsundarraj-px Date: Thu, 2 May 2024 18:00:07 +0000 Subject: [PATCH] Vendor latest stork for PB-6814 Signed-off-by: vsundarraj-px --- go.mod | 2 +- go.sum | 4 ++-- .../stork/pkg/snapshotter/snapshotter_csi.go | 16 ++++++++++++---- vendor/modules.txt | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index b67cd7b45..dd3905b6f 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/hashicorp/go-version v1.6.0 github.com/kubernetes-csi/external-snapshotter/client/v4 v4.2.0 github.com/kubernetes-incubator/external-storage v0.20.4-openstorage-rc7 - github.com/libopenstorage/stork v1.4.1-0.20240423095633-85719d1cbf2c + github.com/libopenstorage/stork v1.4.1-0.20240502174850-59e33b4ea29e github.com/portworx/pxc v0.33.0 github.com/portworx/sched-ops v1.20.4-rc1.0.20240331082638-605dbf61e0be github.com/sirupsen/logrus v1.9.3 diff --git a/go.sum b/go.sum index 632b83db2..2418729a8 100644 --- a/go.sum +++ b/go.sum @@ -3362,8 +3362,8 @@ github.com/libopenstorage/stork v1.4.1-0.20230502135851-9cacb19e1df5/go.mod h1:R github.com/libopenstorage/stork v1.4.1-0.20230519043154-cbc10dffaf19/go.mod h1:Xm4DHoViynFXMQKBXGj3IkA77LY2RBFkNtv6vbo3wNw= github.com/libopenstorage/stork v1.4.1-0.20230601053837-5dd68f026569/go.mod h1:+mKPMCPNhS/XOF2RPcNFijkr67CCCWp0o8OXVG6xxAk= github.com/libopenstorage/stork v1.4.1-0.20230610103146-72cf75320066/go.mod h1:Yst+fnOYjWk6SA5pXZBKm19wtiinjxQ/vgYTXI3k80Q= -github.com/libopenstorage/stork v1.4.1-0.20240423095633-85719d1cbf2c h1:UhJykH+NaQI4Sskm7gs2NZpuoj8bhQViT0TG7qfuAPQ= -github.com/libopenstorage/stork v1.4.1-0.20240423095633-85719d1cbf2c/go.mod h1:K+1WdxpmU3tS1CJQITl5UlHnV3JLWHXCxTzF9cN7BEM= +github.com/libopenstorage/stork v1.4.1-0.20240502174850-59e33b4ea29e h1:cu6PHdlISYqdLJ/rKmh/C5J+LS9dAga7TZ0JUeqtdVo= +github.com/libopenstorage/stork v1.4.1-0.20240502174850-59e33b4ea29e/go.mod h1:K+1WdxpmU3tS1CJQITl5UlHnV3JLWHXCxTzF9cN7BEM= github.com/libopenstorage/systemutils v0.0.0-20160208220149-44ac83be3ce1/go.mod h1:xwNGC7xiz/BQ/wbMkvHujL8Gjgseg+x41xMek7sKRRQ= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= diff --git a/vendor/github.com/libopenstorage/stork/pkg/snapshotter/snapshotter_csi.go b/vendor/github.com/libopenstorage/stork/pkg/snapshotter/snapshotter_csi.go index 2ab0049db..0c0f2c88d 100644 --- a/vendor/github.com/libopenstorage/stork/pkg/snapshotter/snapshotter_csi.go +++ b/vendor/github.com/libopenstorage/stork/pkg/snapshotter/snapshotter_csi.go @@ -49,11 +49,9 @@ const ( skipResourceAnnotation = "stork.libopenstorage.org/skip-resource" // defaultSnapshotTimeout represents the duration to wait before timing out on snapshot completion - defaultSnapshotTimeout = time.Minute * 5 + defaultSnapshotTimeout = time.Minute * 30 // SnapshotTimeoutKey represents the duration to wait before timing out on snapshot completion SnapshotTimeoutKey = "SNAPSHOT_TIMEOUT" - // restoreTimeout is the duration to wait before timing out the restore - restoreTimeout = time.Minute * 5 // snapDeleteAnnotation needs to be set if volume snapshot is scheduled for deletion snapDeleteAnnotation = "snapshotScheduledForDeletion" // snapRestoreAnnotation needs to be set if volume snapshot is scheduled for restore @@ -741,7 +739,12 @@ func (c *csiDriver) RestoreStatus(pvcName, namespace string) (RestoreInfo, error } } } - + // Lets use SNAPSHOT_TIMEOUT for restoreTimeout as well. + restoreTimeout, err := getSnapshotTimeout() + if err == nil { + logrus.Warnf("failed to obtain timeout value for snapshot %s: %v, falling back on default snapshot timeout value %s", vsName, err, defaultSnapshotTimeout.String()) + restoreTimeout = defaultSnapshotTimeout + } if time.Now().After(pvc.CreationTimestamp.Add(restoreTimeout)) { restoreInfo.Status = StatusFailed restoreInfo.Reason = formatReasonErrorMessage(fmt.Sprintf("PVC restore timeout out after %s", restoreTimeout.String()), vsError, vscError) @@ -1561,6 +1564,11 @@ func (c *csiDriver) RestoreFromLocalSnapshot(backupLocation *storkapi.BackupLoca } // create a new pvc for restore from the snapshot + if pvc.Spec.Selector != nil { + // Remove the labelselector, as it is a dynamic provisioning. + logrus.Debugf("RestoreFromLocalSnapshot: pvc:%v/%v - pvc.Spec.Selector: %v", pvc.Namespace, pvc.Name, pvc.Spec.Selector) + pvc.Spec.Selector = nil + } pvcName := pvc.Name pvc, err = c.RestoreVolumeClaim( RestoreSnapshotName(vsName), diff --git a/vendor/modules.txt b/vendor/modules.txt index a59055881..ea97d8f7d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -441,7 +441,7 @@ github.com/libopenstorage/openstorage-sdk-clients/sdk/golang github.com/libopenstorage/secrets github.com/libopenstorage/secrets/aws/credentials github.com/libopenstorage/secrets/k8s -# github.com/libopenstorage/stork v1.4.1-0.20240423095633-85719d1cbf2c +# github.com/libopenstorage/stork v1.4.1-0.20240502174850-59e33b4ea29e ## explicit; go 1.21 github.com/libopenstorage/stork/drivers github.com/libopenstorage/stork/drivers/volume