diff --git a/go.mod b/go.mod index 898a5b6ad..d31e68bd8 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,7 @@ module github.com/openshift-kni/lifecycle-agent go 1.22.4 - -toolchain go1.22.7 +toolchain go1.22.9 require ( github.com/coreos/go-semver v0.3.1 @@ -21,7 +20,7 @@ require ( github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 - github.com/vmware-tanzu/velero v1.13.2 + github.com/vmware-tanzu/velero v1.15.0 go.uber.org/mock v0.4.0 golang.org/x/crypto v0.27.0 gopkg.in/yaml.v3 v3.0.1 diff --git a/go.sum b/go.sum index 98168321f..0a2545ae8 100644 --- a/go.sum +++ b/go.sum @@ -235,8 +235,8 @@ github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0o github.com/vincent-petithory/dataurl v0.0.0-20160330182126-9a301d65acbb/go.mod h1:FHafX5vmDzyP+1CQATJn7WFKc9CvnvxyvZy6I1MrG/U= github.com/vincent-petithory/dataurl v1.0.0 h1:cXw+kPto8NLuJtlMsI152irrVw9fRDX8AbShPRpg2CI= github.com/vincent-petithory/dataurl v1.0.0/go.mod h1:FHafX5vmDzyP+1CQATJn7WFKc9CvnvxyvZy6I1MrG/U= -github.com/vmware-tanzu/velero v1.13.2 h1:72Rw+11HJB6XUYfH9/M/jle6duSLyGhMisMMYFr/1qs= -github.com/vmware-tanzu/velero v1.13.2/go.mod h1:yHFPyr+iwpKRf66xJ88MriAHiX58tTnKmQXY2FQZClM= +github.com/vmware-tanzu/velero v1.15.0 h1:+S/lNSDwQqlROGWfmNuZnnabopGmco978COIt3AP09c= +github.com/vmware-tanzu/velero v1.15.0/go.mod h1:28VhzPJRBo91GBRkgs4Ird0fx2vCpepBWmhF+5Pn/WQ= github.com/vmware/vmw-guestinfo v0.0.0-20170707015358-25eff159a728/go.mod h1:x9oS4Wk2s2u4tS29nEaDLdzvuHdB19CvSGJjPgkZJNk= github.com/vmware/vmw-ovflib v0.0.0-20170608004843-1f217b9dc714/go.mod h1:jiPk45kn7klhByRvUq5i2vo1RtHKBHj+iWGFpxbXuuI= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= diff --git a/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/backup_repository_types.go b/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/backup_repository_types.go index 6a062c4fe..af02c123e 100644 --- a/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/backup_repository_types.go +++ b/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/backup_repository_types.go @@ -41,6 +41,11 @@ type BackupRepositorySpec struct { // MaintenanceFrequency is how often maintenance should be run. MaintenanceFrequency metav1.Duration `json:"maintenanceFrequency"` + + // RepositoryConfig is for repository-specific configuration fields. + // +optional + // +nullable + RepositoryConfig map[string]string `json:"repositoryConfig,omitempty"` } // BackupRepositoryPhase represents the lifecycle phase of a BackupRepository. diff --git a/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/backup_types.go b/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/backup_types.go index 66a827bf0..858894dc7 100644 --- a/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/backup_types.go +++ b/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/backup_types.go @@ -159,7 +159,7 @@ type BackupSpec struct { CSISnapshotTimeout metav1.Duration `json:"csiSnapshotTimeout,omitempty"` // ItemOperationTimeout specifies the time used to wait for asynchronous BackupItemAction operations - // The default value is 1 hour. + // The default value is 4 hour. // +optional ItemOperationTimeout metav1.Duration `json:"itemOperationTimeout,omitempty"` // ResourcePolicy specifies the referenced resource policies that backup should follow diff --git a/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/download_request_types.go b/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/download_request_types.go index 07f44b38d..f23118fe5 100644 --- a/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/download_request_types.go +++ b/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/download_request_types.go @@ -25,7 +25,7 @@ type DownloadRequestSpec struct { } // DownloadTargetKind represents what type of file to download. -// +kubebuilder:validation:Enum=BackupLog;BackupContents;BackupVolumeSnapshots;BackupItemOperations;BackupResourceList;BackupResults;RestoreLog;RestoreResults;RestoreResourceList;RestoreItemOperations;CSIBackupVolumeSnapshots;CSIBackupVolumeSnapshotContents;BackupVolumeInfos +// +kubebuilder:validation:Enum=BackupLog;BackupContents;BackupVolumeSnapshots;BackupItemOperations;BackupResourceList;BackupResults;RestoreLog;RestoreResults;RestoreResourceList;RestoreItemOperations;CSIBackupVolumeSnapshots;CSIBackupVolumeSnapshotContents;BackupVolumeInfos;RestoreVolumeInfo type DownloadTargetKind string const ( @@ -42,6 +42,7 @@ const ( DownloadTargetKindCSIBackupVolumeSnapshots DownloadTargetKind = "CSIBackupVolumeSnapshots" DownloadTargetKindCSIBackupVolumeSnapshotContents DownloadTargetKind = "CSIBackupVolumeSnapshotContents" DownloadTargetKindBackupVolumeInfos DownloadTargetKind = "BackupVolumeInfos" + DownloadTargetKindRestoreVolumeInfo DownloadTargetKind = "RestoreVolumeInfo" ) // DownloadTarget is the specification for what kind of file to download, and the name of the diff --git a/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/labels_annotations.go b/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/labels_annotations.go index 08b6b2440..c86b4e91b 100644 --- a/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/labels_annotations.go +++ b/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/labels_annotations.go @@ -97,6 +97,10 @@ const ( // VolumesToExcludeAnnotation is the annotation on a pod whose mounted volumes // should be excluded from pod volume backup. VolumesToExcludeAnnotation = "backup.velero.io/backup-volumes-excludes" + + // ExcludeFromBackupLabel is the label to exclude k8s resource from backup, + // even if the resource contains a matching selector label. + ExcludeFromBackupLabel = "velero.io/exclude-from-backup" ) type AsyncOperationIDPrefix string @@ -111,3 +115,37 @@ type VeleroResourceUsage string const ( VeleroResourceUsageDataUploadResult VeleroResourceUsage = "DataUpload" ) + +// CSI related plugin actions' constant variable +const ( + VolumeSnapshotLabel = "velero.io/volume-snapshot-name" + VolumeSnapshotHandleAnnotation = "velero.io/csi-volumesnapshot-handle" + VolumeSnapshotRestoreSize = "velero.io/csi-volumesnapshot-restore-size" + DriverNameAnnotation = "velero.io/csi-driver-name" + VSCDeletionPolicyAnnotation = "velero.io/csi-vsc-deletion-policy" + VolumeSnapshotClassSelectorLabel = "velero.io/csi-volumesnapshot-class" + VolumeSnapshotClassDriverBackupAnnotationPrefix = "velero.io/csi-volumesnapshot-class" + VolumeSnapshotClassDriverPVCAnnotation = "velero.io/csi-volumesnapshot-class" + + // There is no release w/ these constants exported. Using the strings for now. + // CSI Annotation volumesnapshotclass + // https://github.com/kubernetes-csi/external-snapshotter/blob/master/pkg/utils/util.go#L59-L60 + PrefixedListSecretNameAnnotation = "csi.storage.k8s.io/snapshotter-list-secret-name" // #nosec G101 + PrefixedListSecretNamespaceAnnotation = "csi.storage.k8s.io/snapshotter-list-secret-namespace" // #nosec G101 + + // CSI Annotation volumesnapshotcontents + PrefixedSecretNameAnnotation = "csi.storage.k8s.io/snapshotter-secret-name" // #nosec G101 + PrefixedSecretNamespaceAnnotation = "csi.storage.k8s.io/snapshotter-secret-namespace" // #nosec G101 + + // Velero checks this annotation to determine whether to skip resource excluding check. + MustIncludeAdditionalItemAnnotation = "backup.velero.io/must-include-additional-items" + // SkippedNoCSIPVAnnotation - Velero checks this annotation on processed PVC to + // find out if the snapshot was skipped b/c the PV is not provisioned via CSI + SkippedNoCSIPVAnnotation = "backup.velero.io/skipped-no-csi-pv" + + // DynamicPVRestoreLabel is the label key for dynamic PV restore + DynamicPVRestoreLabel = "velero.io/dynamic-pv-restore" + + // DataUploadNameAnnotation is the label key for the DataUpload name + DataUploadNameAnnotation = "velero.io/data-upload-name" +) diff --git a/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/restore_types.go b/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/restore_types.go index 417813152..377a92737 100644 --- a/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/restore_types.go +++ b/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/restore_types.go @@ -26,7 +26,8 @@ import ( type RestoreSpec struct { // BackupName is the unique name of the Velero backup to restore // from. - BackupName string `json:"backupName"` + // +optional + BackupName string `json:"backupName,omitempty"` // ScheduleName is the unique name of the Velero schedule to restore // from. If specified, and BackupName is empty, Velero will restore @@ -115,7 +116,7 @@ type RestoreSpec struct { ExistingResourcePolicy PolicyType `json:"existingResourcePolicy,omitempty"` // ItemOperationTimeout specifies the time used to wait for RestoreItemAction operations - // The default value is 1 hour. + // The default value is 4 hour. // +optional ItemOperationTimeout metav1.Duration `json:"itemOperationTimeout,omitempty"` @@ -136,6 +137,9 @@ type UploaderConfigForRestore struct { // +optional // +nullable WriteSparseFiles *bool `json:"writeSparseFiles,omitempty"` + // ParallelFilesDownload is the concurrency number setting for restore. + // +optional + ParallelFilesDownload int `json:"parallelFilesDownload,omitempty"` } // RestoreHooks contains custom behaviors that should be executed during or post restore. @@ -249,7 +253,7 @@ type InitRestoreHook struct { // RestorePhase is a string representation of the lifecycle phase // of a Velero restore -// +kubebuilder:validation:Enum=New;FailedValidation;InProgress;WaitingForPluginOperations;WaitingForPluginOperationsPartiallyFailed;Completed;PartiallyFailed;Failed +// +kubebuilder:validation:Enum=New;FailedValidation;InProgress;WaitingForPluginOperations;WaitingForPluginOperationsPartiallyFailed;Completed;PartiallyFailed;Failed;Finalizing;FinalizingPartiallyFailed type RestorePhase string const ( @@ -277,6 +281,19 @@ const ( // ongoing. The restore is not complete yet. RestorePhaseWaitingForPluginOperationsPartiallyFailed RestorePhase = "WaitingForPluginOperationsPartiallyFailed" + // RestorePhaseFinalizing means the restore of + // Kubernetes resources and other async plugin operations were successful and + // other plugin operations are now complete, but the restore is awaiting + // the completion of wrap-up tasks before the restore process enters terminal phase. + RestorePhaseFinalizing RestorePhase = "Finalizing" + + // RestorePhaseFinalizingPartiallyFailed means the restore of + // Kubernetes resources and other async plugin operations were successful and + // other plugin operations are now complete, but one or more errors + // occurred during restore or async operation processing. The restore is awaiting + // the completion of wrap-up tasks before the restore process enters terminal phase. + RestorePhaseFinalizingPartiallyFailed RestorePhase = "FinalizingPartiallyFailed" + // RestorePhaseCompleted means the restore has run successfully // without errors. RestorePhaseCompleted RestorePhase = "Completed" diff --git a/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/zz_generated.deepcopy.go b/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/zz_generated.deepcopy.go index 18d881959..03f98b425 100644 --- a/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/vmware-tanzu/velero/pkg/apis/velero/v1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated // Code generated by controller-gen. DO NOT EDIT. @@ -112,7 +111,7 @@ func (in *BackupRepository) DeepCopyInto(out *BackupRepository) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec + in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) } @@ -170,6 +169,13 @@ func (in *BackupRepositoryList) DeepCopyObject() runtime.Object { func (in *BackupRepositorySpec) DeepCopyInto(out *BackupRepositorySpec) { *out = *in out.MaintenanceFrequency = in.MaintenanceFrequency + if in.RepositoryConfig != nil { + in, out := &in.RepositoryConfig, &out.RepositoryConfig + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupRepositorySpec. diff --git a/vendor/modules.txt b/vendor/modules.txt index a3b959d1c..753ecf339 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -483,8 +483,8 @@ github.com/ulikunitz/xz/lzma # github.com/vincent-petithory/dataurl v1.0.0 ## explicit github.com/vincent-petithory/dataurl -# github.com/vmware-tanzu/velero v1.13.2 -## explicit; go 1.21 +# github.com/vmware-tanzu/velero v1.15.0 +## explicit; go 1.22.8 github.com/vmware-tanzu/velero/pkg/apis/velero/shared github.com/vmware-tanzu/velero/pkg/apis/velero/v1 # github.com/x448/float16 v0.8.4