mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-10-01 12:15:36 +00:00
@@ -46,6 +46,7 @@ type podTemplateConfig struct {
|
||||
defaultVolumesToFsBackup bool
|
||||
serviceAccountName string
|
||||
uploaderType string
|
||||
defaultSnapshotMoveData bool
|
||||
}
|
||||
|
||||
func WithImage(image string) podTemplateOption {
|
||||
@@ -136,6 +137,12 @@ func WithDefaultVolumesToFsBackup() podTemplateOption {
|
||||
}
|
||||
}
|
||||
|
||||
func WithDefaultSnapshotMoveData() podTemplateOption {
|
||||
return func(c *podTemplateConfig) {
|
||||
c.defaultSnapshotMoveData = true
|
||||
}
|
||||
}
|
||||
|
||||
func WithServiceAccountName(sa string) podTemplateOption {
|
||||
return func(c *podTemplateConfig) {
|
||||
c.serviceAccountName = sa
|
||||
@@ -167,6 +174,10 @@ func Deployment(namespace string, opts ...podTemplateOption) *appsv1.Deployment
|
||||
args = append(args, "--default-volumes-to-fs-backup=true")
|
||||
}
|
||||
|
||||
if c.defaultSnapshotMoveData {
|
||||
args = append(args, "--default-snapshot-move-data=true")
|
||||
}
|
||||
|
||||
if len(c.uploaderType) > 0 {
|
||||
args = append(args, fmt.Sprintf("--uploader-type=%s", c.uploaderType))
|
||||
}
|
||||
|
||||
@@ -243,6 +243,7 @@ type VeleroOptions struct {
|
||||
Features []string
|
||||
DefaultVolumesToFsBackup bool
|
||||
UploaderType string
|
||||
DefaultSnapshotMoveData bool
|
||||
}
|
||||
|
||||
func AllCRDs() *unstructured.UnstructuredList {
|
||||
@@ -343,6 +344,10 @@ func AllResources(o *VeleroOptions) *unstructured.UnstructuredList {
|
||||
deployOpts = append(deployOpts, WithDefaultVolumesToFsBackup())
|
||||
}
|
||||
|
||||
if o.DefaultSnapshotMoveData {
|
||||
deployOpts = append(deployOpts, WithDefaultSnapshotMoveData())
|
||||
}
|
||||
|
||||
deploy := Deployment(o.Namespace, deployOpts...)
|
||||
|
||||
if err := appendUnstructured(resources, deploy); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user