diff --git a/changelogs/unreleased/4725-jxun b/changelogs/unreleased/4725-jxun deleted file mode 100644 index f9e0e4d94..000000000 --- a/changelogs/unreleased/4725-jxun +++ /dev/null @@ -1 +0,0 @@ -Support multiple skip option for E2E test \ No newline at end of file diff --git a/pkg/backup/pod_action.go b/pkg/backup/pod_action.go index 0fd479a71..bd1005500 100644 --- a/pkg/backup/pod_action.go +++ b/pkg/backup/pod_action.go @@ -1,5 +1,5 @@ /* -Copyright 2017 the Velero contributors. +Copyright 2017, 2022 the Velero contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/backup/pod_action_test.go b/pkg/backup/pod_action_test.go index c1a7f0e0a..80c9127d6 100644 --- a/pkg/backup/pod_action_test.go +++ b/pkg/backup/pod_action_test.go @@ -1,5 +1,5 @@ /* -Copyright 2018 the Velero contributors. +Copyright 2018, 2022 the Velero contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -115,6 +115,25 @@ func TestPodActionExecute(t *testing.T) { {GroupResource: kuberesource.PersistentVolumeClaims, Namespace: "foo", Name: "claim2"}, }, }, + { + name: "test priority class", + pod: velerotest.UnstructuredOrDie(` + { + "apiVersion": "v1", + "kind": "Pod", + "metadata": { + "namespace": "foo", + "name": "bar" + }, + "spec": { + "priorityClassName": "testPriorityClass" + } + } + `), + expected: []velero.ResourceIdentifier{ + {GroupResource: kuberesource.PriorityClasses, Name: "testPriorityClass"}, + }, + }, } for _, test := range tests { diff --git a/pkg/kuberesource/kuberesource.go b/pkg/kuberesource/kuberesource.go index c6dd36a05..a3a087244 100644 --- a/pkg/kuberesource/kuberesource.go +++ b/pkg/kuberesource/kuberesource.go @@ -1,5 +1,5 @@ /* -Copyright 2018 the Velero contributors. +Copyright 2018, 2022 the Velero contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/restore/pod_action.go b/pkg/restore/pod_action.go index 4db9da722..adfc83c0d 100644 --- a/pkg/restore/pod_action.go +++ b/pkg/restore/pod_action.go @@ -1,5 +1,5 @@ /* -Copyright 2017 the Velero contributors. +Copyright 2017, 2022 the Velero contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/restore/pod_action_test.go b/pkg/restore/pod_action_test.go index 1d0165541..c638b7229 100644 --- a/pkg/restore/pod_action_test.go +++ b/pkg/restore/pod_action_test.go @@ -1,5 +1,5 @@ /* -Copyright 2017, 2019 the Velero contributors. +Copyright 2017, 2019, 2022 the Velero contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,6 +17,8 @@ limitations under the License. package restore import ( + "github.com/vmware-tanzu/velero/pkg/kuberesource" + //"github.com/vmware-tanzu/velero/pkg/kuberesource" "testing" "github.com/stretchr/testify/assert" @@ -34,10 +36,11 @@ func TestPodActionExecute(t *testing.T) { var priority int32 = 1 tests := []struct { - name string - obj corev1api.Pod - expectedErr bool - expectedRes corev1api.Pod + name string + obj corev1api.Pod + expectedErr bool + expectedRes corev1api.Pod + additionalItems []velero.ResourceIdentifier }{ { name: "nodeName (only) should be deleted from spec", @@ -189,6 +192,35 @@ func TestPodActionExecute(t *testing.T) { }, }, }, + { + name: "test priority class", + obj: corev1api.Pod{ + ObjectMeta: metav1.ObjectMeta{Name: "pod-1"}, + Spec: corev1api.PodSpec{ + ServiceAccountName: "foo", + PriorityClassName: "testPriorityClass", + Volumes: []corev1api.Volume{ + {Name: "foo"}, + {Name: "foo-token-foo"}, + }, + }, + }, + expectedRes: corev1api.Pod{ + ObjectMeta: metav1.ObjectMeta{Name: "pod-1"}, + Spec: corev1api.PodSpec{ + ServiceAccountName: "foo", + PriorityClassName: "testPriorityClass", + Volumes: []corev1api.Volume{ + {Name: "foo"}, + }, + }, + }, + additionalItems: []velero.ResourceIdentifier{ + {GroupResource: kuberesource.PriorityClasses, + Name: "testPriorityClass", + }, + }, + }, } for _, test := range tests { @@ -214,6 +246,7 @@ func TestPodActionExecute(t *testing.T) { require.NoError(t, runtime.DefaultUnstructuredConverter.FromUnstructured(res.UpdatedItem.UnstructuredContent(), &pod)) assert.Equal(t, test.expectedRes, pod) + assert.Equal(t, test.additionalItems, res.AdditionalItems) }) } } diff --git a/site/content/docs/v1.8/_index.md b/site/content/docs/v1.8/_index.md index d4a88da6a..74eece82f 100644 --- a/site/content/docs/v1.8/_index.md +++ b/site/content/docs/v1.8/_index.md @@ -33,7 +33,7 @@ If you encounter issues, review the [troubleshooting docs][30], [file an issue][ ## Contributing -If you are ready to jump in and test, add code, or help with documentation, follow the instructions on our [Start contributing](https://velero.io/docs/v1.8/start-contributing/) documentation for guidance on how to setup Velero for development. +If you are ready to jump in and test, add code, or help with documentation, follow the instructions on our [Start contributing](https://velero.io/docs/v1.8.0/start-contributing/) documentation for guidance on how to setup Velero for development. ## Changelog diff --git a/test/e2e/Makefile b/test/e2e/Makefile index 01099282d..b49829ab6 100644 --- a/test/e2e/Makefile +++ b/test/e2e/Makefile @@ -47,7 +47,6 @@ KUSTOMIZE := $(TOOLS_BIN_DIR)/kustomize OUTPUT_DIR := _output/$(GOOS)/$(GOARCH)/bin GINKGO_FOCUS ?= GINKGO_SKIP ?= -SKIP_STR := $(foreach var, $(subst ., ,$(GINKGO_SKIP)),-skip "$(var)") VELERO_CLI ?=$$(pwd)/../../_output/bin/$(GOOS)/$(GOARCH)/velero VELERO_IMAGE ?= velero/velero:main VELERO_VERSION ?= $(VERSION) @@ -87,7 +86,7 @@ run: ginkgo (echo "Bucket to store the backups from E2E tests is required, please re-run with BSL_BUCKET="; exit 1 ) @[ "${CLOUD_PROVIDER}" ] && echo "Using cloud provider ${CLOUD_PROVIDER}" || \ (echo "Cloud provider for target cloud/plug-in provider is required, please rerun with CLOUD_PROVIDER="; exit 1) - @$(GINKGO) -v -focus="$(GINKGO_FOCUS)" $(SKIP_STR) . -- -velerocli=$(VELERO_CLI) \ + @$(GINKGO) -v -focus="$(GINKGO_FOCUS)" -skip="$(GINKGO_SKIP)" . -- -velerocli=$(VELERO_CLI) \ -velero-image=$(VELERO_IMAGE) \ -plugins=$(PLUGINS) \ -velero-version=$(VELERO_VERSION) \