Skip to content

Commit 627f313

Browse files
committed
feat(wip): Add more E2E resources from oadp and fix errors
Signed-off-by: Juan Manuel Parrilla Madrid <[email protected]>
1 parent 585de5b commit 627f313

File tree

2,654 files changed

+381005
-78345
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,654 files changed

+381005
-78345
lines changed

Makefile

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ cover:
5454

5555
.PHONY: deps
5656
deps:
57-
$(GO) mod tidy && $(GO) mod vendor
57+
$(GO) mod tidy && \
58+
$(GO) mod vendor && \
59+
$(GO) mod verify && \
60+
$(GO) list -m -mod=readonly -json all > /dev/null
5861

5962
.PHONY: verify
6063
verify: verify-modules test
@@ -82,4 +85,79 @@ build-dirs:
8285
.PHONY: clean
8386
clean:
8487
@echo "cleaning"
85-
rm -rf _output dist
88+
rm -rf _output dist
89+
90+
.PHONY: install-ginkgo
91+
install-ginkgo: ## Make sure ginkgo is in $GOPATH/bin
92+
go install -v -mod=mod github.com/onsi/ginkgo/v2/ginkgo
93+
94+
.PHONY: login-required
95+
login-required:
96+
ifeq ($(CLUSTER_TYPE),)
97+
$(error You must be logged in to a cluster to run this command)
98+
else
99+
$(info $$CLUSTER_TYPE is [${CLUSTER_TYPE}])
100+
endif
101+
102+
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
103+
define go-install-tool
104+
@[ -f $(1) ] || { \
105+
set -e ;\
106+
TMP_DIR=$$(mktemp -d) ;\
107+
cd $$TMP_DIR ;\
108+
go mod init tmp ;\
109+
echo "Downloading $(2)" ;\
110+
GOBIN=$(PROJECT_DIR)/bin go install -mod=mod $(2) ;\
111+
rm -rf $$TMP_DIR ;\
112+
}
113+
endef
114+
115+
##.PHONY: build-must-gather
116+
##build-must-gather: ## Build OADP Must-gather binary must-gather/oadp-must-gather
117+
## cd must-gather && go build -mod=mod -a -o oadp-must-gather cmd/main.go
118+
119+
# CONFIGS FOR CLOUD
120+
# bsl / blob storage cred dir
121+
OADP_CRED_DIR ?= /var/run/oadp-credentials
122+
# vsl / volume/cluster cred dir
123+
CLUSTER_PROFILE_DIR ?= /Users/drajds/.aws
124+
125+
# bsl cred file
126+
OADP_CRED_FILE ?= ${OADP_CRED_DIR}/new-aws-credentials
127+
# vsl cred file
128+
CI_CRED_FILE ?= ${CLUSTER_PROFILE_DIR}/.awscred
129+
130+
# aws configs - default
131+
BSL_REGION ?= us-west-2
132+
VSL_REGION ?= ${LEASED_RESOURCE}
133+
BSL_AWS_PROFILE ?= default
134+
# BSL_AWS_PROFILE ?= migration-engineering
135+
136+
# bucket file
137+
OADP_BUCKET_FILE ?= ${OADP_CRED_DIR}/new-velero-bucket-name
138+
# azure cluster resource file - only in CI
139+
AZURE_RESOURCE_FILE ?= /var/run/secrets/ci.openshift.io/multi-stage/metadata.json
140+
AZURE_CI_JSON_CRED_FILE ?= ${CLUSTER_PROFILE_DIR}/osServicePrincipal.json
141+
AZURE_OADP_JSON_CRED_FILE ?= ${OADP_CRED_DIR}/azure-credentials
142+
143+
OPENSHIFT_CI ?= true
144+
OADP_BUCKET ?= $(shell cat $(OADP_BUCKET_FILE))
145+
SETTINGS_TMP=/tmp/test-settings
146+
147+
.PHONY: test-e2e-setup
148+
test-e2e-setup: login-required #build-must-gather
149+
mkdir -p $(SETTINGS_TMP)
150+
TMP_DIR=$(SETTINGS_TMP) \
151+
OPENSHIFT_CI="$(OPENSHIFT_CI)" \
152+
PROVIDER="$(VELERO_PLUGIN)" \
153+
AZURE_RESOURCE_FILE="$(AZURE_RESOURCE_FILE)" \
154+
CI_JSON_CRED_FILE="$(AZURE_CI_JSON_CRED_FILE)" \
155+
OADP_JSON_CRED_FILE="$(AZURE_OADP_JSON_CRED_FILE)" \
156+
OADP_CRED_FILE="$(OADP_CRED_FILE)" \
157+
BUCKET="$(OADP_BUCKET)" \
158+
TARGET_CI_CRED_FILE="$(CI_CRED_FILE)" \
159+
VSL_REGION="$(VSL_REGION)" \
160+
BSL_REGION="$(BSL_REGION)" \
161+
BSL_AWS_PROFILE="$(BSL_AWS_PROFILE)" \
162+
SKIP_MUST_GATHER="$(SKIP_MUST_GATHER)" \
163+
/bin/bash "tests/e2e/scripts/$(CLUSTER_TYPE)_settings.sh"

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,21 @@ kubectl create secret generic cloud-credentials \
1414
```
1515
4. Create the DataProtectionApplication (sample in `examples` folder)
1616
5. Fill and create the backup manifest (sample in `examples` folder)
17-
6. Check the Backup status.
17+
6. Check the Backup status.
18+
19+
20+
## Testing
21+
22+
```sh
23+
OADP_CRED_FILE=<path_to_backupLocations_credentials_file>
24+
OADP_BUCKET=<bucket_name>
25+
CI_CRED_FILE=<path_to_snapshotLocations_credentials_file>
26+
VSL_REGION=<snapshotLocations_region>
27+
# non required
28+
BSL_REGION=<backupLocations_region>
29+
OADP_TEST_NAMESPACE=<test_namespace>
30+
OPENSHIFT_CI=false
31+
SKIP_MUST_GATHER=true
32+
33+
TEST_HCP=true make test-e2e GINKGO_ARGS="--ginkgo.focus='HCP Backup and Restore tests'"
34+
```

go.mod

Lines changed: 86 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,37 @@ go 1.23.0
55
toolchain go1.23.6
66

77
require (
8-
github.com/onsi/gomega v1.35.1
8+
github.com/kubernetes-csi/external-snapshotter/client/v4 v4.2.0
9+
github.com/onsi/ginkgo/v2 v2.19.0
10+
github.com/onsi/gomega v1.33.1
11+
github.com/openshift/api v0.0.0-20240524162738-d899f8877d22 // release-4.12
912
github.com/openshift/hive/apis v0.0.0-20241220022629-3f49f26197ff
10-
github.com/openshift/hypershift/api v0.0.0-20250108163049-830af0531d12
13+
github.com/openshift/hypershift/api v0.0.0-20241128081537-8326d865eaf5
14+
github.com/openshift/oadp-operator v0.0.0-20250723202117-0dbb5ed6720d // oadp-1.5 branch
15+
github.com/operator-framework/api v0.10.7
1116
github.com/sirupsen/logrus v1.9.3
12-
github.com/vmware-tanzu/velero v1.14.0
13-
k8s.io/api v0.32.3
17+
github.com/vmware-tanzu/velero v1.16.0-rc.1
18+
k8s.io/api v0.31.3
1419
k8s.io/apiextensions-apiserver v0.31.3
1520
sigs.k8s.io/controller-runtime v0.19.3
1621
)
1722

1823
require (
1924
github.com/beorn7/perks v1.0.1 // indirect
2025
github.com/cespare/xxhash/v2 v2.3.0 // indirect
21-
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
22-
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
23-
github.com/google/gnostic-models v0.6.8 // indirect
24-
github.com/google/go-cmp v0.6.0 // indirect
25-
github.com/google/uuid v1.6.0 // indirect
26-
github.com/klauspost/compress v1.17.11 // indirect
26+
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
27+
github.com/fxamacker/cbor/v2 v2.8.0 // indirect
28+
github.com/google/gnostic-models v0.6.9 // indirect
29+
github.com/google/go-cmp v0.7.0
30+
github.com/google/uuid v1.6.0
2731
github.com/kubernetes-csi/external-snapshotter/client/v7 v7.0.0 // indirect
28-
github.com/openshift/api v0.0.0-20250418132733-f636181788a9 // indirect
2932
github.com/openshift/custom-resource-status v1.1.3-0.20220503160415-f2fdb4999d87 // indirect
30-
github.com/prometheus/client_golang v1.20.5 // indirect
31-
github.com/prometheus/client_model v0.6.1 // indirect
32-
github.com/prometheus/common v0.62.0 // indirect
33-
github.com/prometheus/procfs v0.15.1 // indirect
33+
github.com/prometheus/client_golang v1.22.0 // indirect
34+
github.com/prometheus/client_model v0.6.2 // indirect
35+
github.com/prometheus/common v0.65.0 // indirect
36+
github.com/prometheus/procfs v0.16.1 // indirect
3437
github.com/x448/float16 v0.8.4 // indirect
35-
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect
38+
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
3639
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
3740
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
3841
)
@@ -41,21 +44,20 @@ require (
4144
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
4245
github.com/emicklei/go-restful/v3 v3.11.2 // indirect
4346
github.com/fatih/color v1.18.0 // indirect
44-
github.com/go-logr/logr v1.4.2 // indirect
45-
github.com/go-openapi/jsonpointer v0.21.0 // indirect
46-
github.com/go-openapi/jsonreference v0.20.4 // indirect
47-
github.com/go-openapi/swag v0.23.0 // indirect
47+
github.com/go-logr/logr v1.4.3 // indirect
48+
github.com/go-openapi/jsonpointer v0.21.1 // indirect
49+
github.com/go-openapi/jsonreference v0.21.0 // indirect
50+
github.com/go-openapi/swag v0.23.1 // indirect
4851
github.com/gobwas/glob v0.2.3 // indirect
4952
github.com/gogo/protobuf v1.3.2 // indirect
5053
github.com/golang/protobuf v1.5.4 // indirect
51-
github.com/google/gofuzz v1.2.0 // indirect
52-
github.com/hashicorp/go-hclog v0.14.1 // indirect
54+
github.com/hashicorp/go-hclog v1.2.0 // indirect
5355
github.com/hashicorp/go-plugin v1.6.0 // indirect
5456
github.com/hashicorp/yamux v0.1.1 // indirect
5557
github.com/inconshreveable/mousetrap v1.1.0 // indirect
5658
github.com/josharian/intern v1.0.0 // indirect
5759
github.com/json-iterator/go v1.1.12 // indirect
58-
github.com/mailru/easyjson v0.7.7 // indirect
60+
github.com/mailru/easyjson v0.9.0 // indirect
5961
github.com/mattn/go-colorable v0.1.14 // indirect
6062
github.com/mattn/go-isatty v0.0.20 // indirect
6163
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
@@ -64,27 +66,70 @@ require (
6466
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
6567
github.com/oklog/run v1.0.0 // indirect
6668
github.com/pkg/errors v0.9.1 // indirect
67-
github.com/spf13/cobra v1.8.1 // indirect
68-
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace // indirect
69-
golang.org/x/net v0.38.0 // indirect
70-
golang.org/x/oauth2 v0.27.0 // indirect
71-
golang.org/x/sys v0.31.0 // indirect
72-
golang.org/x/term v0.30.0 // indirect
73-
golang.org/x/text v0.23.0 // indirect
74-
golang.org/x/time v0.9.0 // indirect
75-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
76-
google.golang.org/grpc v1.69.4 // indirect
77-
google.golang.org/protobuf v1.36.3 // indirect
69+
github.com/spf13/cobra v1.9.1 // indirect
70+
github.com/spf13/pflag v1.0.6 // indirect
71+
golang.org/x/net v0.41.0 // indirect
72+
golang.org/x/oauth2 v0.30.0 // indirect
73+
golang.org/x/sys v0.33.0 // indirect
74+
golang.org/x/term v0.32.0 // indirect
75+
golang.org/x/text v0.26.0 // indirect
76+
golang.org/x/time v0.12.0 // indirect
77+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect
78+
google.golang.org/grpc v1.73.0 // indirect
79+
google.golang.org/protobuf v1.36.6 // indirect
7880
gopkg.in/inf.v0 v0.9.1 // indirect
7981
gopkg.in/yaml.v3 v3.0.1 // indirect
80-
k8s.io/apimachinery v0.32.3
81-
k8s.io/client-go v0.32.3
82+
k8s.io/apimachinery v0.31.3
83+
k8s.io/client-go v0.31.3
8284
k8s.io/klog/v2 v2.130.1 // indirect
83-
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
84-
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738
85-
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
86-
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
87-
sigs.k8s.io/yaml v1.4.0 // indirect
85+
k8s.io/kube-openapi v0.0.0-20250610211856-8b98d1ed966a // indirect
86+
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
87+
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
88+
sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect
89+
sigs.k8s.io/yaml v1.5.0 // indirect
90+
)
91+
92+
require (
93+
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
94+
github.com/aws/aws-sdk-go v1.44.253 // indirect
95+
github.com/aws/aws-sdk-go-v2 v1.30.3 // indirect
96+
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 // indirect
97+
github.com/aws/aws-sdk-go-v2/config v1.26.3 // indirect
98+
github.com/aws/aws-sdk-go-v2/credentials v1.17.26 // indirect
99+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 // indirect
100+
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.11 // indirect
101+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 // indirect
102+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 // indirect
103+
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
104+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.10 // indirect
105+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 // indirect
106+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10 // indirect
107+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 // indirect
108+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.10 // indirect
109+
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.0 // indirect
110+
github.com/aws/aws-sdk-go-v2/service/sso v1.22.3 // indirect
111+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 // indirect
112+
github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 // indirect
113+
github.com/aws/smithy-go v1.20.3 // indirect
114+
github.com/blang/semver/v4 v4.0.0 // indirect
115+
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
116+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
117+
github.com/google/gofuzz v1.2.0 // indirect
118+
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
119+
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
120+
github.com/imdario/mergo v0.3.13 // indirect
121+
github.com/jmespath/go-jmespath v0.4.0 // indirect
122+
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
123+
github.com/moby/spdystream v0.5.0 // indirect
124+
github.com/moby/term v0.5.0 // indirect
125+
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
126+
github.com/rogpeppe/go-internal v1.13.1 // indirect
127+
go.opentelemetry.io/otel v1.36.0 // indirect
128+
go.opentelemetry.io/otel/sdk/metric v1.36.0 // indirect
129+
go.yaml.in/yaml/v2 v2.4.2 // indirect
130+
golang.org/x/tools v0.34.0 // indirect
131+
k8s.io/cli-runtime v0.31.3 // indirect
132+
sigs.k8s.io/randfill v1.0.0 // indirect
88133
)
89134

90135
replace github.com/vmware-tanzu/velero => github.com/openshift/velero v0.10.2-0.20250514165055-8fbcf3a8da11

0 commit comments

Comments
 (0)