Skip to content

Commit

Permalink
Remove non-working code for backing up completed build pods
Browse files Browse the repository at this point in the history
No longer needed after by vmware-tanzu/velero#6189 or vmware-tanzu/velero#6188 which fix vmware-tanzu/velero#6182

Signed-off-by: Tiger Kaovilai <[email protected]>
  • Loading branch information
kaovilai committed Jul 12, 2023
1 parent 5dd4863 commit 0a52289
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 209 deletions.
72 changes: 0 additions & 72 deletions velero-plugins/pod/backup.go

This file was deleted.

135 changes: 0 additions & 135 deletions velero-plugins/pod/backup_test.go

This file was deleted.

3 changes: 1 addition & 2 deletions velero-plugins/pod/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/vmware-tanzu/velero/pkg/kuberesource"
"github.com/vmware-tanzu/velero/pkg/label"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
"github.com/vmware-tanzu/velero/pkg/podvolume"
"github.com/vmware-tanzu/velero/pkg/util/boolptr"
"github.com/vmware-tanzu/velero/pkg/util/collections"
corev1API "k8s.io/api/core/v1"
Expand Down Expand Up @@ -123,7 +122,7 @@ func (p *RestorePlugin) Execute(input *velero.RestoreItemActionExecuteInput) (*v
}

// Check if pod has owner Refs and defaultVolumesToRestic flag as false/nil
if (len(ownerRefs) > 0 && pod.Annotations[podvolume.VolumesToBackupAnnotation] == "" && (defaultVolumesToFsBackup == nil || !*defaultVolumesToFsBackup)) && !podHasRestoreHooks {
if (len(ownerRefs) > 0 && pod.Annotations["backup.velero.io/backup-volumes-excludes"] == "" && (defaultVolumesToFsBackup == nil || !*defaultVolumesToFsBackup)) && !podHasRestoreHooks {
p.Log.Infof("[pod-restore] skipping restore of pod %s, has owner references, no restic backup, and no restore hooks", pod.Name)
return velero.NewRestoreItemActionExecuteOutput(input.Item).WithoutRestore(), nil
}
Expand Down

0 comments on commit 0a52289

Please sign in to comment.