rename field

Signed-off-by: Ashish Amarnath <ashisham@vmware.com>
This commit is contained in:
Ashish Amarnath
2020-06-15 15:26:44 -07:00
parent b71173228a
commit b0fd3d35c1
14 changed files with 116 additions and 116 deletions

View File

@@ -71,7 +71,7 @@ type kubernetesBackupper struct {
podCommandExecutor podexec.PodCommandExecutor
resticBackupperFactory restic.BackupperFactory
resticTimeout time.Duration
defaultRestic bool
defaultVolumesToRestic bool
}
type resolvedAction struct {
@@ -104,7 +104,7 @@ func NewKubernetesBackupper(
podCommandExecutor podexec.PodCommandExecutor,
resticBackupperFactory restic.BackupperFactory,
resticTimeout time.Duration,
defaultRestic bool,
defaultVolumesToRestic bool,
) (Backupper, error) {
return &kubernetesBackupper{
backupClient: backupClient,
@@ -113,7 +113,7 @@ func NewKubernetesBackupper(
podCommandExecutor: podCommandExecutor,
resticBackupperFactory: resticBackupperFactory,
resticTimeout: resticTimeout,
defaultRestic: defaultRestic,
defaultVolumesToRestic: defaultVolumesToRestic,
}, nil
}
@@ -243,10 +243,10 @@ func (kb *kubernetesBackupper) Backup(log logrus.FieldLogger, backupRequest *Req
log.Infof("Including resources: %s", backupRequest.ResourceIncludesExcludes.IncludesString())
log.Infof("Excluding resources: %s", backupRequest.ResourceIncludesExcludes.ExcludesString())
if backupRequest.Backup.Spec.DefaultRestic == nil {
backupRequest.Backup.Spec.DefaultRestic = &kb.defaultRestic
if backupRequest.Backup.Spec.DefaultVolumesToRestic == nil {
backupRequest.Backup.Spec.DefaultVolumesToRestic = &kb.defaultVolumesToRestic
}
log.Infof("Backing up all pod volumes using restic: %t", *backupRequest.Backup.Spec.DefaultRestic)
log.Infof("Backing up all pod volumes using restic: %t", *backupRequest.Backup.Spec.DefaultVolumesToRestic)
var err error
backupRequest.ResourceHooks, err = getResourceHooks(backupRequest.Spec.Hooks.Resources, kb.discoveryHelper)

View File

@@ -141,7 +141,7 @@ func (ib *itemBackupper) backupItem(logger logrus.FieldLogger, obj runtime.Unstr
// Get the list of volumes to back up using restic from the pod's annotations. Remove from this list
// any volumes that use a PVC that we've already backed up (this would be in a read-write-many scenario,
// where it's been backed up from another pod), since we don't need >1 backup per PVC.
for _, volume := range restic.GetPodVolumesUsingRestic(pod, boolptr.IsSetToTrue(ib.backupRequest.Spec.DefaultRestic)) {
for _, volume := range restic.GetPodVolumesUsingRestic(pod, boolptr.IsSetToTrue(ib.backupRequest.Spec.DefaultVolumesToRestic)) {
if found, pvcName := ib.resticSnapshotTracker.HasPVCForPodVolume(pod, volume); found {
log.WithFields(map[string]interface{}{
"podVolume": volume,