Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ REGISTRY_CREDENTIAL_FILE ?=
KIBISHII_DIRECTORY ?= github.com/vmware-tanzu-experiments/distributed-data-generator/kubernetes/yaml/
IMAGE_REGISTRY_PROXY ?=

# Parameters for labels and annotations for Velero pods and service accounts.
POD_LABELS ?=
SA_ANNOTATIONS ?=

# Flags to create an additional BSL for multiple credentials tests
ADDITIONAL_BSL_PLUGINS ?=
Expand Down Expand Up @@ -224,7 +227,9 @@ run-e2e: ginkgo
--kibishii-directory=$(KIBISHII_DIRECTORY) \
--disable-informer-cache=$(DISABLE_INFORMER_CACHE) \
--image-registry-proxy=$(IMAGE_REGISTRY_PROXY) \
--worker-os=$(WORKER_OS)
--worker-os=$(WORKER_OS) \
--pod-labels=$(POD_LABELS) \
--sa-annotations=$(SA_ANNOTATIONS)

.PHONY: run-perf
run-perf: ginkgo
Expand Down
13 changes: 13 additions & 0 deletions test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,19 @@ func init() {
"linux",
"test k8s worker node OS version, should be either linux or windows.",
)

flag.StringVar(
&test.VeleroCfg.PodLabels,
"pod-labels",
"",
"comma-separated list of key=value labels to add to the Velero pod",
)
flag.StringVar(
&test.VeleroCfg.ServiceAccountAnnotations,
"sa-annotations",
"",
"comma-separated list of key=value annotations to add to Velero service account",
)
}

// Add label [SkipVanillaZfs]:
Expand Down
2 changes: 2 additions & 0 deletions test/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ type VeleroConfig struct {
CloudProvider string
ObjectStoreProvider string
VeleroNamespace string
PodLabels string
ServiceAccountAnnotations string
AdditionalBSLProvider string
AdditionalBSLBucket string
AdditionalBSLPrefix string
Expand Down
8 changes: 8 additions & 0 deletions test/util/velero/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,14 @@ func installVeleroServer(
args = append(args, fmt.Sprintf("--item-block-worker-count=%d", options.ItemBlockWorkerCount))
}

if len(options.PodLabels.Data()) > 0 {
args = append(args, "--pod-labels", options.PodLabels.String())
}

if len(options.ServiceAccountAnnotations.Data()) > 0 {
args = append(args, "--sa-annotations", options.ServiceAccountAnnotations.String())
}

// Only version no older than v1.15 support --backup-repository-configmap.
if options.BackupRepoConfigMap != "" &&
(semver.Compare(version, "v1.15") >= 0 || version == "main") {
Expand Down
6 changes: 6 additions & 0 deletions test/util/velero/velero_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@ func getProviderVeleroInstallOptions(veleroCfg *VeleroConfig,
io.VolumeSnapshotConfig = flag.NewMap()
io.VolumeSnapshotConfig.Set(veleroCfg.VSLConfig)

io.PodLabels = flag.NewMap()
io.PodLabels.Set(veleroCfg.PodLabels)

io.ServiceAccountAnnotations = flag.NewMap()
io.ServiceAccountAnnotations.Set(veleroCfg.ServiceAccountAnnotations)

io.Plugins = flag.NewStringArray(plugins...)
io.Features = veleroCfg.Features
io.DefaultVolumesToFsBackup = veleroCfg.DefaultVolumesToFsBackup
Expand Down
Loading