Skip to content

Commit

Permalink
Bump Velero version.
Browse files Browse the repository at this point in the history
Replace some const variables definination with references from
Velero.

Signed-off-by: Xun Jiang <[email protected]>
  • Loading branch information
Xun Jiang committed Dec 12, 2023
1 parent f58c5fc commit b6326d2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
// TODO: need to use velero v1.12.0 after releasing.
github.com/vmware-tanzu/velero v0.0.0-20231206102534-099acd2527ca
github.com/vmware-tanzu/velero v0.0.0-20231212044725-5f14628d696e
k8s.io/api v0.25.6
k8s.io/apimachinery v0.25.6
k8s.io/client-go v0.25.6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,8 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/vmware-tanzu/velero v0.0.0-20231206102534-099acd2527ca h1:Q7+6LvH0WSLL7benq3MbYkkNMpCMENPnORgdAcvmOc8=
github.com/vmware-tanzu/velero v0.0.0-20231206102534-099acd2527ca/go.mod h1:yAsKjuJCEJBQhLOttEckJRplx6sLSOfrRZjEzqoQVJs=
github.com/vmware-tanzu/velero v0.0.0-20231212044725-5f14628d696e h1:zMMt5SjWEYKU90iy9ALecKEOMtURsAhfoYerVfPThX4=
github.com/vmware-tanzu/velero v0.0.0-20231212044725-5f14628d696e/go.mod h1:yAsKjuJCEJBQhLOttEckJRplx6sLSOfrRZjEzqoQVJs=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
Expand Down
5 changes: 2 additions & 3 deletions internal/backup/pvc_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ import (
"github.com/vmware-tanzu/velero/pkg/label"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
biav2 "github.com/vmware-tanzu/velero/pkg/plugin/velero/backupitemaction/v2"
uploaderUtil "github.com/vmware-tanzu/velero/pkg/uploader/util"
"github.com/vmware-tanzu/velero/pkg/util/boolptr"
)

const parallelFilesUpload = "ParallelFilesUpload"

// PVCBackupItemAction is a backup item action plugin for Velero.
type PVCBackupItemAction struct {
Log logrus.FieldLogger
Expand Down Expand Up @@ -347,7 +346,7 @@ func newDataUpload(backup *velerov1api.Backup, vs *snapshotv1api.VolumeSnapshot,

if backup.Spec.UploaderConfig != nil && backup.Spec.UploaderConfig.ParallelFilesUpload > 0 {
dataUpload.Spec.DataMoverConfig = make(map[string]string)
dataUpload.Spec.DataMoverConfig[parallelFilesUpload] = fmt.Sprintf("%d", backup.Spec.UploaderConfig.ParallelFilesUpload)
dataUpload.Spec.DataMoverConfig[uploaderUtil.ParallelFilesUpload] = fmt.Sprintf("%d", backup.Spec.UploaderConfig.ParallelFilesUpload)
}

return dataUpload
Expand Down
6 changes: 3 additions & 3 deletions internal/restore/pvc_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (
"github.com/vmware-tanzu/velero/pkg/label"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
riav2 "github.com/vmware-tanzu/velero/pkg/plugin/velero/restoreitemaction/v2"
uploaderUtil "github.com/vmware-tanzu/velero/pkg/uploader/util"
"github.com/vmware-tanzu/velero/pkg/util/boolptr"
)

Expand All @@ -54,7 +55,6 @@ const (

const (
GenerateNameRandomLength = 5
writeSparseFiles = "WriteSparseFiles"
)

// PVCRestoreItemAction is a restore item action plugin for Velero
Expand Down Expand Up @@ -400,9 +400,9 @@ func newDataDownload(restore *velerov1api.Restore, backup *velerov1api.Backup, d
if restore.Spec.UploaderConfig != nil {
dataDownload.Spec.DataMoverConfig = make(map[string]string)
if boolptr.IsSetToTrue(restore.Spec.UploaderConfig.WriteSparseFiles) {
dataDownload.Spec.DataMoverConfig[writeSparseFiles] = "true"
dataDownload.Spec.DataMoverConfig[uploaderUtil.WriteSparseFiles] = "true"
} else {
dataDownload.Spec.DataMoverConfig[writeSparseFiles] = "false"
dataDownload.Spec.DataMoverConfig[uploaderUtil.WriteSparseFiles] = "false"
}
}
return dataDownload
Expand Down

0 comments on commit b6326d2

Please sign in to comment.