23
23
$(warning Could not find docker or podman in path! This may result in targets requiring a container runtime failing!)
24
24
endif
25
25
26
- # For standard development and release flows, we use the config/overlays/cert-manager overlay.
27
- KUSTOMIZE_OVERLAY := config/overlays/cert-manager
28
-
29
26
# bingo manages consistent tooling versions for things like kind, kustomize, etc.
30
27
include ./../.bingo/Variables.mk
31
28
@@ -38,14 +35,6 @@ ifeq ($(origin KIND_CLUSTER_NAME), undefined)
38
35
KIND_CLUSTER_NAME := catalogd
39
36
endif
40
37
41
- # E2E configuration
42
- TESTDATA_DIR := testdata
43
-
44
- CATALOGD_NAMESPACE := olmv1-system
45
- KIND_CLUSTER_IMAGE := kindest/node:v1.30.0@sha256:047357ac0cfea04663786a612ba1eaba9702bef25227a794b52890dd8bcd692e
46
-
47
- GINKGO := go run github.com/onsi/ginkgo/v2/ginkgo
48
-
49
38
# #@ General
50
39
51
40
# The help target prints out all targets with their descriptions organized
@@ -74,34 +63,6 @@ generate: $(CONTROLLER_GEN) ## Generate code and manifests.
74
63
$(CONTROLLER_GEN ) object:headerFile=" ../hack/boilerplate.go.txt" paths=" ./..."
75
64
$(CONTROLLER_GEN ) rbac:roleName=manager-role crd webhook paths=" ./..." output:crd:artifacts:config=config/base/crd/bases output:rbac:artifacts:config=config/base/rbac output:webhook:artifacts:config=config/base/manager/webhook/
76
65
77
- FOCUS := $(if $(TEST ) ,-v -focus "$(TEST ) ")
78
- ifeq ($(origin E2E_FLAGS ) , undefined)
79
- E2E_FLAGS :=
80
- endif
81
-
82
- image-registry : # # Setup in-cluster image registry
83
- ./../test/tools/imageregistry/registry.sh $(ISSUER_KIND ) $(ISSUER_NAME )
84
-
85
- # # image-registry target has to come after run-latest-release,
86
- # # because the image-registry depends on the olm-ca issuer.
87
- .PHONY : test-upgrade-e2e
88
- test-upgrade-e2e : export TEST_CLUSTER_CATALOG_NAME := test-catalog
89
- test-upgrade-e2e : export TEST_CLUSTER_CATALOG_IMAGE := docker-registry.catalogd-e2e.svc:5000/test-catalog:e2e
90
- test-upgrade-e2e : ISSUER_KIND=ClusterIssuer
91
- test-upgrade-e2e : ISSUER_NAME=olmv1-ca
92
- test-upgrade-e2e : kind-cluster cert-manager build-container kind-load run-latest-release image-registry pre-upgrade-setup only-deploy-manifest wait post-upgrade-checks kind-cluster-cleanup # # Run upgrade e2e tests on a local kind cluster
93
-
94
- pre-upgrade-setup :
95
- ./test/tools/imageregistry/pre-upgrade-setup.sh ${TEST_CLUSTER_CATALOG_IMAGE} ${TEST_CLUSTER_CATALOG_NAME}
96
-
97
- .PHONY : run-latest-release
98
- run-latest-release :
99
- cd ..; curl -L -s https://github.com/operator-framework/operator-controller/releases/latest/download/install.sh | bash -s
100
-
101
- .PHONY : post-upgrade-checks
102
- post-upgrade-checks :
103
- $(GINKGO ) $(E2E_FLAGS ) -trace -vv $(FOCUS ) test/upgrade
104
-
105
66
# #@ Build
106
67
107
68
BINARIES =catalogd
@@ -149,62 +110,16 @@ $(LINUX_BINARIES): BUILDBIN = bin/linux
149
110
$(LINUX_BINARIES ) :
150
111
GOOS=linux $(BUILDCMD )
151
112
152
-
153
- .PHONY : run
154
- run : generate kind-cluster install # # Create a kind cluster and install a local build of catalogd
155
-
156
113
.PHONY : build-container
157
114
build-container : build-linux # # Build docker image for catalogd.
158
115
$(CONTAINER_RUNTIME ) build -f Dockerfile -t $(IMAGE ) ./bin/linux
159
116
160
- # #@ Deploy
161
-
162
- .PHONY : kind-cluster
163
- kind-cluster : $(KIND ) kind-cluster-cleanup # # Standup a kind cluster
164
- $(KIND ) create cluster --name $(KIND_CLUSTER_NAME ) --image $(KIND_CLUSTER_IMAGE )
165
- $(KIND ) export kubeconfig --name $(KIND_CLUSTER_NAME )
166
-
167
- .PHONY : kind-cluster-cleanup
168
- kind-cluster-cleanup : $(KIND ) # # Delete the kind cluster
169
- $(KIND ) delete cluster --name $(KIND_CLUSTER_NAME )
170
-
171
117
.PHONY : kind-load
172
- kind-load : check-cluster $(KIND ) # # Load the built images onto the local cluster
118
+ kind-load : $(KIND ) # # Load the built images onto the local cluster
173
119
$(CONTAINER_RUNTIME ) save $(IMAGE ) | $(KIND ) load image-archive /dev/stdin --name $(KIND_CLUSTER_NAME )
174
120
175
- .PHONY : install
176
- install : check-cluster build-container kind-load deploy wait # # Install local catalogd to an existing cluster
177
-
178
- .PHONY : deploy
179
- deploy : export MANIFEST="./catalogd.yaml"
180
- deploy : export DEFAULT_CATALOGS="./config/base/default/clustercatalogs/default-catalogs.yaml"
181
- deploy : $(KUSTOMIZE ) # # Deploy Catalogd to the K8s cluster specified in ~/.kube/config with cert-manager and default clustercatalogs
182
- cd config/base/manager && $(KUSTOMIZE ) edit set image controller=$(IMAGE ) && cd ../../..
183
- $(KUSTOMIZE ) build $(KUSTOMIZE_OVERLAY ) | sed " s/cert-git-version/cert-$( GIT_VERSION) /g" > catalogd.yaml
184
- envsubst ' $$CERT_MGR_VERSION,$$MANIFEST,$$DEFAULT_CATALOGS' < scripts/install.tpl.sh | bash -s
185
-
186
- .PHONY : only-deploy-manifest
187
- only-deploy-manifest : $(KUSTOMIZE ) # # Deploy just the Catalogd manifest--used in e2e testing where cert-manager is installed in a separate step
188
- cd config/base/manager && $(KUSTOMIZE ) edit set image controller=$(IMAGE )
189
- $(KUSTOMIZE ) build $(KUSTOMIZE_OVERLAY ) | kubectl apply -f -
190
-
191
- wait :
192
- kubectl wait --for=condition=Available --namespace=$(CATALOGD_NAMESPACE ) deployment/catalogd-controller-manager --timeout=60s
193
- kubectl wait --for=condition=Ready --namespace=$(CATALOGD_NAMESPACE ) certificate/catalogd-service-cert # Avoid upgrade test flakes when reissuing cert
194
-
195
-
196
- .PHONY : cert-manager
197
- cert-manager :
198
- kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/${CERT_MGR_VERSION} /cert-manager.yaml
199
- kubectl wait --for=condition=Available --namespace=cert-manager deployment/cert-manager-webhook --timeout=60s
121
+ # #@ Deploy
200
122
201
123
.PHONY : demo-update
202
124
demo-update :
203
125
hack/scripts/generate-asciidemo.sh
204
-
205
- .PHONY : check-cluster
206
- check-cluster :
207
- @kubectl config current-context > /dev/null 2>&1 || ( \
208
- echo " Error: Could not get current Kubernetes context. Maybe use 'run' or 'e2e' targets first?" ; \
209
- exit 1; \
210
- )
0 commit comments