windows support for vgdp ms for pvb
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>pull/9021/head
parent
7d8a36a6e0
commit
749d57db3e
|
@ -44,6 +44,8 @@ RUN mkdir -p /output/usr/bin && \
|
||||||
export GOARM=$( echo "${GOARM}" | cut -c2-) && \
|
export GOARM=$( echo "${GOARM}" | cut -c2-) && \
|
||||||
go build -o /output/${BIN}.exe \
|
go build -o /output/${BIN}.exe \
|
||||||
-ldflags "${LDFLAGS}" ${PKG}/cmd/${BIN} && \
|
-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 \
|
go build -o /output/velero-helper.exe \
|
||||||
-ldflags "${LDFLAGS}" ${PKG}/cmd/velero-helper && \
|
-ldflags "${LDFLAGS}" ${PKG}/cmd/velero-helper && \
|
||||||
go clean -modcache -cache
|
go clean -modcache -cache
|
||||||
|
|
|
@ -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
|
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)
|
err := nodeagent.IsRunningInNode(b.ctx, backup.Namespace, pod.Spec.NodeName, b.crClient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
skipAllPodVolumes(pod, volumesToBackup, err, pvcSummary, log)
|
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
|
var podVolumeBackups []*velerov1api.PodVolumeBackup
|
||||||
// if no pod volume backups are tracked, return directly to avoid issue mentioned in
|
// if no pod volume backups are tracked, return directly to avoid issue mentioned in
|
||||||
// https://github.com/vmware-tanzu/velero/issues/8723
|
// 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()
|
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) {
|
func TestBackupPodVolumes(t *testing.T) {
|
||||||
scheme := runtime.NewScheme()
|
scheme := runtime.NewScheme()
|
||||||
velerov1api.AddToScheme(scheme)
|
velerov1api.AddToScheme(scheme)
|
||||||
|
@ -367,22 +363,6 @@ func TestBackupPodVolumes(t *testing.T) {
|
||||||
uploaderType: "kopia",
|
uploaderType: "kopia",
|
||||||
bsl: "fake-bsl",
|
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",
|
name: "node-agent pod is not running in node",
|
||||||
volumes: []string{
|
volumes: []string{
|
||||||
|
|
|
@ -213,12 +213,6 @@ func (r *restorer) RestorePodVolumes(data RestoreData, tracker *volume.RestoreVo
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
r.log.WithError(err).Error("Failed to check node-agent pod status, disengage")
|
r.log.WithError(err).Error("Failed to check node-agent pod status, disengage")
|
||||||
} else {
|
} 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)
|
err = nodeagent.IsRunningInNode(checkCtx, data.Restore.Namespace, nodeName, r.crClient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.log.WithField("node", nodeName).WithError(err).Error("node-agent pod is not running in node, abort the restore")
|
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",
|
name: "node-agent pod is not running",
|
||||||
pvbs: []*velerov1api.PodVolumeBackup{
|
pvbs: []*velerov1api.PodVolumeBackup{
|
||||||
|
|
Loading…
Reference in New Issue