mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-03 03:35:22 +00:00
Merge pull request #9021 from Lyndon-Li/vgdp-ms-windows-support
Some checks failed
Run the E2E test on kind / build (push) Failing after 6m18s
Run the E2E test on kind / setup-test-matrix (push) Successful in 2s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 34s
Close stale issues and PRs / stale (push) Successful in 11s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 2m39s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-aws, main) (push) Failing after 1m32s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-gcp, main) (push) Failing after 1m2s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-microsoft-azure, main) (push) Failing after 1m5s
Some checks failed
Run the E2E test on kind / build (push) Failing after 6m18s
Run the E2E test on kind / setup-test-matrix (push) Successful in 2s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 34s
Close stale issues and PRs / stale (push) Successful in 11s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 2m39s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-aws, main) (push) Failing after 1m32s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-gcp, main) (push) Failing after 1m2s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-microsoft-azure, main) (push) Failing after 1m5s
Windows support for vgdp ms for pvb
This commit is contained in:
@@ -44,6 +44,8 @@ RUN mkdir -p /output/usr/bin && \
|
||||
export GOARM=$( echo "${GOARM}" | cut -c2-) && \
|
||||
go build -o /output/${BIN}.exe \
|
||||
-ldflags "${LDFLAGS}" ${PKG}/cmd/${BIN} && \
|
||||
go build -o /output/velero-restore-helper.exe \
|
||||
-ldflags "${LDFLAGS}" ${PKG}/cmd/velero-restore-helper && \
|
||||
go build -o /output/velero-helper.exe \
|
||||
-ldflags "${LDFLAGS}" ${PKG}/cmd/velero-helper && \
|
||||
go clean -modcache -cache
|
||||
|
||||
1
changelogs/unreleased/9021-Lyndon-Li
Normal file
1
changelogs/unreleased/9021-Lyndon-Li
Normal file
@@ -0,0 +1 @@
|
||||
Fix issue #8964, add Windows support for VGDP MS for fs-backup
|
||||
@@ -268,12 +268,6 @@ func (b *backupper) BackupPodVolumes(backup *velerov1api.Backup, pod *corev1api.
|
||||
return nil, pvcSummary, nil
|
||||
}
|
||||
|
||||
if err := kube.IsLinuxNode(b.ctx, pod.Spec.NodeName, b.crClient); err != nil {
|
||||
err := errors.Wrapf(err, "Pod %s/%s is not running in linux node(%s), skip", pod.Namespace, pod.Name, pod.Spec.NodeName)
|
||||
skipAllPodVolumes(pod, volumesToBackup, err, pvcSummary, log)
|
||||
return nil, pvcSummary, []error{err}
|
||||
}
|
||||
|
||||
err := nodeagent.IsRunningInNode(b.ctx, backup.Namespace, pod.Spec.NodeName, b.crClient)
|
||||
if err != nil {
|
||||
skipAllPodVolumes(pod, volumesToBackup, err, pvcSummary, log)
|
||||
@@ -406,6 +400,8 @@ func (b *backupper) WaitAllPodVolumesProcessed(log logrus.FieldLogger) []*velero
|
||||
}
|
||||
}()
|
||||
|
||||
log.Info("Waiting for completion of PVB")
|
||||
|
||||
var podVolumeBackups []*velerov1api.PodVolumeBackup
|
||||
// if no pod volume backups are tracked, return directly to avoid issue mentioned in
|
||||
// https://github.com/vmware-tanzu/velero/issues/8723
|
||||
|
||||
@@ -307,10 +307,6 @@ func createNodeObj() *corev1api.Node {
|
||||
return builder.ForNode("fake-node-name").Labels(map[string]string{"kubernetes.io/os": "linux"}).Result()
|
||||
}
|
||||
|
||||
func createWindowsNodeObj() *corev1api.Node {
|
||||
return builder.ForNode("fake-node-name").Labels(map[string]string{"kubernetes.io/os": "windows"}).Result()
|
||||
}
|
||||
|
||||
func TestBackupPodVolumes(t *testing.T) {
|
||||
scheme := runtime.NewScheme()
|
||||
velerov1api.AddToScheme(scheme)
|
||||
@@ -367,22 +363,6 @@ func TestBackupPodVolumes(t *testing.T) {
|
||||
uploaderType: "kopia",
|
||||
bsl: "fake-bsl",
|
||||
},
|
||||
{
|
||||
name: "pod is not running on Linux node",
|
||||
volumes: []string{
|
||||
"fake-volume-1",
|
||||
"fake-volume-2",
|
||||
},
|
||||
kubeClientObj: []runtime.Object{
|
||||
createNodeAgentPodObj(true),
|
||||
createWindowsNodeObj(),
|
||||
},
|
||||
sourcePod: createPodObj(false, false, false, 2),
|
||||
uploaderType: "kopia",
|
||||
errs: []string{
|
||||
"Pod fake-ns/fake-pod is not running in linux node(fake-node-name), skip",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "node-agent pod is not running in node",
|
||||
volumes: []string{
|
||||
|
||||
@@ -213,12 +213,6 @@ func (r *restorer) RestorePodVolumes(data RestoreData, tracker *volume.RestoreVo
|
||||
} else if err != nil {
|
||||
r.log.WithError(err).Error("Failed to check node-agent pod status, disengage")
|
||||
} else {
|
||||
if err := kube.IsLinuxNode(checkCtx, nodeName, r.crClient); err != nil {
|
||||
r.log.WithField("node", nodeName).WithError(err).Error("Restored pod is not running in linux node")
|
||||
r.nodeAgentCheck <- errors.Wrapf(err, "restored pod %s/%s is not running in linux node(%s)", data.Pod.Namespace, data.Pod.Name, nodeName)
|
||||
return
|
||||
}
|
||||
|
||||
err = nodeagent.IsRunningInNode(checkCtx, data.Restore.Namespace, nodeName, r.crClient)
|
||||
if err != nil {
|
||||
r.log.WithField("node", nodeName).WithError(err).Error("node-agent pod is not running in node, abort the restore")
|
||||
|
||||
@@ -313,30 +313,6 @@ func TestRestorePodVolumes(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "pod is not running on linux nodes",
|
||||
pvbs: []*velerov1api.PodVolumeBackup{
|
||||
createPVBObj(true, true, 1, "kopia"),
|
||||
},
|
||||
kubeClientObj: []runtime.Object{
|
||||
createNodeAgentDaemonset(),
|
||||
createWindowsNodeObj(),
|
||||
createPVCObj(1),
|
||||
createPodObj(true, true, true, 1),
|
||||
},
|
||||
ctlClientObj: []runtime.Object{
|
||||
createBackupRepoObj(),
|
||||
},
|
||||
restoredPod: createPodObj(true, true, true, 1),
|
||||
sourceNamespace: "fake-ns",
|
||||
bsl: "fake-bsl",
|
||||
runtimeScheme: scheme,
|
||||
errs: []expectError{
|
||||
{
|
||||
err: "restored pod fake-ns/fake-pod is not running in linux node(fake-node-name): os type windows for node fake-node-name is not linux",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "node-agent pod is not running",
|
||||
pvbs: []*velerov1api.PodVolumeBackup{
|
||||
|
||||
Reference in New Issue
Block a user