mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-06 13:26:26 +00:00
@@ -81,7 +81,7 @@ type CreateOptions struct {
|
||||
Name string
|
||||
TTL time.Duration
|
||||
SnapshotVolumes flag.OptionalBool
|
||||
DefaultRestic flag.OptionalBool
|
||||
DefaultVolumesToRestic flag.OptionalBool
|
||||
IncludeNamespaces flag.StringArray
|
||||
ExcludeNamespaces flag.StringArray
|
||||
IncludeResources flag.StringArray
|
||||
@@ -125,7 +125,7 @@ func (o *CreateOptions) BindFlags(flags *pflag.FlagSet) {
|
||||
f = flags.VarPF(&o.IncludeClusterResources, "include-cluster-resources", "", "include cluster-scoped resources in the backup")
|
||||
f.NoOptDefVal = "true"
|
||||
|
||||
f = flags.VarPF(&o.DefaultRestic, "default-restic", "", "use restic by default to backup all pod volumes")
|
||||
f = flags.VarPF(&o.DefaultVolumesToRestic, "default-volumes-to-restic", "", "use restic by default to backup all pod volumes")
|
||||
f.NoOptDefVal = "true"
|
||||
}
|
||||
|
||||
@@ -299,8 +299,8 @@ func (o *CreateOptions) BuildBackup(namespace string) (*velerov1api.Backup, erro
|
||||
if o.IncludeClusterResources.Value != nil {
|
||||
backupBuilder.IncludeClusterResources(*o.IncludeClusterResources.Value)
|
||||
}
|
||||
if o.DefaultRestic.Value != nil {
|
||||
backupBuilder.DefaultRestic(*o.DefaultRestic.Value)
|
||||
if o.DefaultVolumesToRestic.Value != nil {
|
||||
backupBuilder.DefaultVolumesToRestic(*o.DefaultVolumesToRestic.Value)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ type serverConfig struct {
|
||||
profilerAddress string
|
||||
formatFlag *logging.FormatFlag
|
||||
defaultResticMaintenanceFrequency time.Duration
|
||||
defaultRestic bool
|
||||
defaultVolumesToRestic bool
|
||||
}
|
||||
|
||||
type controllerRunInfo struct {
|
||||
@@ -153,7 +153,7 @@ func NewCommand(f client.Factory) *cobra.Command {
|
||||
resourceTerminatingTimeout: defaultResourceTerminatingTimeout,
|
||||
formatFlag: logging.NewFormatFlag(),
|
||||
defaultResticMaintenanceFrequency: restic.DefaultMaintenanceFrequency,
|
||||
defaultRestic: restic.DefaultRestic,
|
||||
defaultVolumesToRestic: restic.DefaultVolumesToRestic,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -215,7 +215,7 @@ func NewCommand(f client.Factory) *cobra.Command {
|
||||
command.Flags().DurationVar(&config.resourceTerminatingTimeout, "terminating-resource-timeout", config.resourceTerminatingTimeout, "how long to wait on persistent volumes and namespaces to terminate during a restore before timing out")
|
||||
command.Flags().DurationVar(&config.defaultBackupTTL, "default-backup-ttl", config.defaultBackupTTL, "how long to wait by default before backups can be garbage collected")
|
||||
command.Flags().DurationVar(&config.defaultResticMaintenanceFrequency, "default-restic-prune-frequency", config.defaultResticMaintenanceFrequency, "how often 'restic prune' is run for restic repositories by default")
|
||||
command.Flags().BoolVar(&config.defaultRestic, "default-restic", config.defaultRestic, "backup all volumes with restic by default")
|
||||
command.Flags().BoolVar(&config.defaultVolumesToRestic, "default-volumes-to-restic", config.defaultVolumesToRestic, "backup all volumes with restic by default")
|
||||
|
||||
return command
|
||||
}
|
||||
@@ -640,7 +640,7 @@ func (s *server) runControllers(defaultVolumeSnapshotLocations map[string]string
|
||||
podexec.NewPodCommandExecutor(s.kubeClientConfig, s.kubeClient.CoreV1().RESTClient()),
|
||||
s.resticManager,
|
||||
s.config.podVolumeOperationTimeout,
|
||||
s.config.defaultRestic,
|
||||
s.config.defaultVolumesToRestic,
|
||||
)
|
||||
cmd.CheckError(err)
|
||||
|
||||
@@ -655,7 +655,7 @@ func (s *server) runControllers(defaultVolumeSnapshotLocations map[string]string
|
||||
backupTracker,
|
||||
s.sharedInformerFactory.Velero().V1().BackupStorageLocations().Lister(),
|
||||
s.config.defaultBackupLocation,
|
||||
s.config.defaultRestic,
|
||||
s.config.defaultVolumesToRestic,
|
||||
s.config.defaultBackupTTL,
|
||||
s.sharedInformerFactory.Velero().V1().VolumeSnapshotLocations().Lister(),
|
||||
defaultVolumeSnapshotLocations,
|
||||
|
||||
Reference in New Issue
Block a user