Skip to content

Commit a1d42a8

Browse files
committed
Update cOnfiguration for experimental/standard manifests
* Move feature overlays to be components. * Create experimental and e2e overlays and manifests. * Use e2e manifests for testing. * Create `test-experimental-e2e` target. * Remove unused webhook manifests. * Add run of experimental-e2e This is a first step, mostly moving things around, and there's a lot of duplication in the overlays. This also fixes the issue with the current test-e2e modifying the standard manifest with e2e parameters, leaving a dirty workspace. This changes the manifest used buy the e2e test to be it's own standard-e2e manifest. Signed-off-by: Todd Short <[email protected]>
1 parent fca620f commit a1d42a8

34 files changed

+6019
-76
lines changed

.github/workflows/e2e.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,26 @@ jobs:
4848
flags: e2e
4949
token: ${{ secrets.CODECOV_TOKEN }}
5050

51+
experimental-e2e:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v4
55+
with:
56+
fetch-depth: 0
57+
58+
- uses: actions/setup-go@v5
59+
with:
60+
go-version-file: go.mod
61+
62+
- name: Run e2e tests
63+
run: ARTIFACT_PATH=/tmp/artifacts make test-experimental-e2e
64+
65+
- uses: actions/upload-artifact@v4
66+
if: failure()
67+
with:
68+
name: experimental-e2e-artifacts
69+
path: /tmp/artifacts/
70+
5171
upgrade-e2e:
5272
runs-on: ubuntu-latest
5373
steps:

Makefile

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ else
7171
$(warning Could not find docker or podman in path! This may result in targets requiring a container runtime failing!)
7272
endif
7373

74-
KUSTOMIZE_BUILD_DIR := config/overlays/cert-manager
74+
KUSTOMIZE_STANDARD_OVERLAY := config/overlays/standard
75+
KUSTOMIZE_STANDARD_E2E_OVERLAY := config/overlays/standard-e2e
76+
KUSTOMIZE_EXPERIMENTAL_OVERLAY := config/overlays/experimental
77+
KUSTOMIZE_EXPERIMENTAL_E2E_OVERLAY := config/overlays/experimental-e2e
7578

7679
export RELEASE_MANIFEST := operator-controller.yaml
7780
export RELEASE_INSTALL := install.sh
@@ -80,8 +83,14 @@ export RELEASE_CATALOGS := default-catalogs.yaml
8083
# List of manifests that are checked in
8184
MANIFEST_HOME := ./manifests
8285
STANDARD_MANIFEST := ./manifests/standard.yaml
86+
STANDARD_E2E_MANIFEST := ./manifests/standard-e2e.yaml
87+
EXPERIMENTAL_MANIFEST := ./manifests/experimental.yaml
88+
EXPERIMENTAL_E2E_MANIFEST := ./manifests/experimental-e2e.yaml
8389
CATALOGS_MANIFEST := ./manifests/default-catalogs.yaml
8490

91+
# Manifest used by kind-deploy, which may be overridden by other targets
92+
SOURCE_MANIFEST := ./manifests/standard.yaml
93+
8594
# Disable -j flag for make
8695
.NOTPARALLEL:
8796

@@ -147,7 +156,10 @@ manifests: $(CONTROLLER_GEN) $(KUSTOMIZE) #EXHELP Generate WebhookConfiguration,
147156
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR)
148157
# Generate manifests stored in source-control
149158
mkdir -p $(MANIFEST_HOME)
150-
$(KUSTOMIZE) build $(KUSTOMIZE_BUILD_DIR) > $(STANDARD_MANIFEST)
159+
$(KUSTOMIZE) build $(KUSTOMIZE_STANDARD_OVERLAY) > $(STANDARD_MANIFEST)
160+
$(KUSTOMIZE) build $(KUSTOMIZE_STANDARD_E2E_OVERLAY) > $(STANDARD_E2E_MANIFEST)
161+
$(KUSTOMIZE) build $(KUSTOMIZE_EXPERIMENTAL_OVERLAY) > $(EXPERIMENTAL_MANIFEST)
162+
$(KUSTOMIZE) build $(KUSTOMIZE_EXPERIMENTAL_E2E_OVERLAY) > $(EXPERIMENTAL_E2E_MANIFEST)
151163

152164
.PHONY: generate
153165
generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -247,11 +259,17 @@ image-registry: ## Build the testdata catalog used for e2e tests and push it to
247259
#
248260
# for example: ARTIFACT_PATH=/tmp/artifacts make test-e2e
249261
.PHONY: test-e2e
262+
test-e2e: SOURCE_MANIFEST := $(STANDARD_E2E_MANIFEST)
250263
test-e2e: KIND_CLUSTER_NAME := operator-controller-e2e
251-
test-e2e: KUSTOMIZE_BUILD_DIR := config/overlays/e2e
252264
test-e2e: GO_BUILD_EXTRA_FLAGS := -cover
253265
test-e2e: run image-registry prometheus e2e e2e-metrics e2e-coverage kind-clean #HELP Run e2e test suite on local kind cluster
254266

267+
.PHONY: test-experimental-e2e
268+
test-experimental-e2e: SOURCE_MANIFEST := $(EXPERIMENTAL_E2E_MANIFEST)
269+
test-experimental-e2e: KIND_CLUSTER_NAME := operator-controller-e2e
270+
test-experimental-e2e: GO_BUILD_EXTRA_FLAGS := -cover
271+
test-experimental-e2e: run image-registry prometheus e2e e2e-metrics e2e-coverage kind-clean #HELP Run experimental e2e test suite on local kind cluster
272+
255273
.PHONY: prometheus
256274
prometheus: PROMETHEUS_NAMESPACE := olmv1-system
257275
prometheus: PROMETHEUS_VERSION := v0.83.0
@@ -270,7 +288,7 @@ e2e-metrics: #HELP Request metrics from prometheus; place in ARTIFACT_PATH if se
270288
http://localhost:30900/api/v1/query > $(if $(ARTIFACT_PATH),$(ARTIFACT_PATH),.)/metrics.out
271289

272290
.PHONY: extension-developer-e2e
273-
extension-developer-e2e: KUSTOMIZE_BUILD_DIR := config/overlays/cert-manager
291+
extension-developer-e2e: KUSTOMIZE_STANDARD_OVERLAY := config/overlays/cert-manager
274292
extension-developer-e2e: KIND_CLUSTER_NAME := operator-controller-ext-dev-e2e
275293
extension-developer-e2e: export INSTALL_DEFAULT_CATALOGS := false
276294
extension-developer-e2e: run image-registry test-ext-dev-e2e kind-clean #EXHELP Run extension-developer e2e on local kind cluster
@@ -308,7 +326,8 @@ kind-load: $(KIND) #EXHELP Loads the currently constructed images into the KIND
308326
kind-deploy: export MANIFEST := $(RELEASE_MANIFEST)
309327
kind-deploy: export DEFAULT_CATALOG := $(RELEASE_CATALOGS)
310328
kind-deploy: manifests
311-
sed "s/cert-git-version/cert-$(VERSION)/g" $(STANDARD_MANIFEST) > $(MANIFEST)
329+
@echo -e "\n\U1F4D8 Using $(SOURCE_MANIFEST) as source manifest\n"
330+
sed "s/cert-git-version/cert-$(VERSION)/g" $(SOURCE_MANIFEST) > $(MANIFEST)
312331
cp $(CATALOGS_MANIFEST) $(DEFAULT_CATALOG)
313332
envsubst '$$DEFAULT_CATALOG,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh | bash -s
314333

config/README.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This includes basic support for an insecure OLMv1 deployment. This configuration
77
* config/base/operator-controller
88
* config/base/common
99

10-
## config/overlays/cert-manager
10+
## config/overlays/standard
1111

1212
This includes support for a secure (i.e. with TLS) configuration of OLMv1. This configuration uses:
1313
* config/base/catalogd
@@ -19,18 +19,22 @@ This includes support for a secure (i.e. with TLS) configuration of OLMv1. This
1919

2020
This configuration requires cert-manager.
2121

22-
## config/overlays/e2e
22+
## config/overlays/standard-e2e
2323

24-
This provides additional configuration support for end-to-end testing, including code coverage. This configuration uses:
25-
* config/base/catalogd
26-
* config/base/operator-controller
27-
* config/base/common
28-
* config/components/coverage
29-
* config/components/tls/catalogd
30-
* config/components/tls/operator-controller
31-
* config/components/tls/ca
24+
This provides additional configuration support for end-to-end testing, including code coverage. This configuration is based on `standard`, but also includes:
25+
* config/components/e2e/coverage
26+
* config/components/e2e/registries-conf
3227

33-
This configuration requires cert-manager.
28+
## config/overlays/experimental
29+
30+
This provides additional configuration experimental features. This configuration is based on `standard`, but also includes:
31+
* config/compinents/features/*
32+
33+
## config/overlays/experimental-e2e
34+
35+
This provides additional configuration support for end-to-end testing, including code coverage, and experimental features. This configuration is based on `experimental`, but also includes:
36+
* config/components/e2e/coverage
37+
* config/components/e2e/registries-conf
3438

3539
## Base Configuration
3640

@@ -52,6 +56,10 @@ This provides common components to both operator-controller and catalogd, i.e. n
5256

5357
Each of the `kustomization.yaml` files specify a `Component`, rather than an overlay, and thus, can be used within the overlays.
5458

59+
### config/components/features
60+
61+
This is the location for feature-gated configuration.
62+
5563
### config/components/tls/catalogd
5664

5765
This provides a basic configuration of catalogd with TLS support.
@@ -72,6 +80,10 @@ This component _does not_ specify a namespace, and _must_ be included last.
7280

7381
This component requires cert-manager.
7482

75-
### config/components/coverage
83+
### config/components/e2e/coverage
84+
85+
Provides code coverage configuration for end-to-end testing.
86+
87+
### config/components/e2e/registries-conf
7688

77-
Provides configuration for code coverage.
89+
Provides registry configuration for for end-to-end testing.

config/base/catalogd/crd/kustomization.yaml renamed to config/base/catalogd/crd/experimental/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# since it depends on service name and namespace that are out of this kustomize package.
33
# It should be run by config/default
44
resources:
5-
- standard/olm.operatorframework.io_clustercatalogs.yaml
5+
- olm.operatorframework.io_clustercatalogs.yaml
66
#+kubebuilder:scaffold:crdkustomizeresource
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# This kustomization.yaml is not intended to be run by itself,
2+
# since it depends on service name and namespace that are out of this kustomize package.
3+
# It should be run by config/default
4+
resources:
5+
- olm.operatorframework.io_clustercatalogs.yaml
6+
#+kubebuilder:scaffold:crdkustomizeresource

config/base/catalogd/kustomization.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ kind: Kustomization
33
namespace: olmv1-system
44
namePrefix: catalogd-
55
resources:
6-
- crd
76
- rbac
87
- manager

config/base/operator-controller/crd/kustomization.yaml renamed to config/base/operator-controller/crd/experimental/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# since it depends on service name and namespace that are out of this kustomize package.
33
# It should be run by config/default
44
resources:
5-
- standard/olm.operatorframework.io_clusterextensions.yaml
5+
- olm.operatorframework.io_clusterextensions.yaml
66

77
# the following config is for teaching kustomize how to do kustomization for CRDs.
88
configurations:
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This kustomization.yaml is not intended to be run by itself,
2+
# since it depends on service name and namespace that are out of this kustomize package.
3+
# It should be run by config/default
4+
resources:
5+
- olm.operatorframework.io_clusterextensions.yaml
6+
7+
# the following config is for teaching kustomize how to do kustomization for CRDs.
8+
configurations:
9+
- kustomizeconfig.yaml
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This file is for teaching kustomize how to substitute name and namespace reference in CRD
2+
nameReference:
3+
- kind: Service
4+
version: v1
5+
fieldSpecs:
6+
- kind: CustomResourceDefinition
7+
version: v1
8+
group: apiextensions.k8s.io
9+
path: spec/conversion/webhook/clientConfig/service/name
10+
11+
namespace:
12+
- kind: CustomResourceDefinition
13+
version: v1
14+
group: apiextensions.k8s.io
15+
path: spec/conversion/webhook/clientConfig/service/namespace
16+
create: false
17+
18+
varReference:
19+
- path: metadata/annotations

config/base/operator-controller/kustomization.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@ kind: Kustomization
33
namespace: olmv1-system
44
namePrefix: operator-controller-
55
resources:
6-
- crd
76
- rbac
87
- manager
9-

config/overlays/featuregate/synthetic-user-permissions/kustomization.yaml renamed to config/components/features/synthetic-user-permissions/kustomization.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
# kustomization file for OLMv1 support for synthetic auth
22
# DO NOT ADD A NAMESPACE HERE
3-
apiVersion: kustomize.config.k8s.io/v1beta1
4-
kind: Kustomization
5-
resources:
6-
- ../../../base/operator-controller
7-
- ../../../base/common
8-
components:
9-
- ../../../components/tls/operator-controller
10-
3+
apiVersion: kustomize.config.k8s.io/v1alpha1
4+
kind: Component
115
patches:
126
- target:
137
kind: Deployment

config/overlays/featuregate/webhook-provider-certmanager/kustomization.yaml renamed to config/components/features/webhook-provider-certmanager/kustomization.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
# kustomization file for cert-manager backed OLMv1 support for installation of bundles with webhooks
22
# DO NOT ADD A NAMESPACE HERE
3-
apiVersion: kustomize.config.k8s.io/v1beta1
4-
kind: Kustomization
5-
resources:
6-
- ../../../base/operator-controller
7-
- ../../../base/common
8-
components:
9-
- ../../../components/tls/operator-controller
10-
3+
apiVersion: kustomize.config.k8s.io/v1alpha1
4+
kind: Component
115
patches:
126
- target:
137
kind: Deployment

config/overlays/featuregate/webhook-provider-openshift-serviceca/kustomization.yaml renamed to config/components/features/webhook-provider-openshift-serviceca/kustomization.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
# kustomization file for openshift-serviceca backed OLMv1 support for installation of bundles with webhooks
22
# DO NOT ADD A NAMESPACE HERE
3-
apiVersion: kustomize.config.k8s.io/v1beta1
4-
kind: Kustomization
5-
resources:
6-
- ../../../base/operator-controller
7-
- ../../../base/common
8-
components:
9-
- ../../../components/tls/operator-controller
10-
3+
apiVersion: kustomize.config.k8s.io/v1alpha1
4+
kind: Component
115
patches:
126
- target:
137
kind: Deployment
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# kustomization file for all the e2e's
2+
# DO NOT ADD A NAMESPACE HERE
3+
apiVersion: kustomize.config.k8s.io/v1beta1
4+
kind: Kustomization
5+
resources:
6+
- ../../base/catalogd
7+
- ../../base/catalogd/crd/experimental
8+
- ../../base/operator-controller
9+
- ../../base/operator-controller/crd/experimental
10+
- ../../base/common
11+
components:
12+
- ../../components/features/synthetic-user-permissions
13+
- ../../components/features/webhook-provider-certmanager
14+
- ../../components/features/webhook-provider-openshift-serviceca
15+
- ../../components/tls/catalogd
16+
- ../../components/tls/operator-controller
17+
- ../../components/e2e/coverage
18+
- ../../components/e2e/registries-conf
19+
# ca must be last or other components will overwrite the namespaces
20+
- ../../components/tls/ca
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# kustomization file for secure OLMv1
2+
# DO NOT ADD A NAMESPACE HERE
3+
apiVersion: kustomize.config.k8s.io/v1beta1
4+
kind: Kustomization
5+
resources:
6+
- ../../base/catalogd
7+
- ../../base/catalogd/crd/experimental
8+
- ../../base/operator-controller
9+
- ../../base/operator-controller/crd/experimental
10+
- ../../base/common
11+
components:
12+
- ../../components/features/synthetic-user-permissions
13+
- ../../components/features/webhook-provider-certmanager
14+
- ../../components/features/webhook-provider-openshift-serviceca
15+
- ../../components/tls/catalogd
16+
- ../../components/tls/operator-controller
17+
# ca must be last other components will overwrite the namespaces
18+
- ../../components/tls/ca

config/overlays/e2e/kustomization.yaml renamed to config/overlays/standard-e2e/kustomization.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ apiVersion: kustomize.config.k8s.io/v1beta1
44
kind: Kustomization
55
resources:
66
- ../../base/catalogd
7+
- ../../base/catalogd/crd/standard
78
- ../../base/operator-controller
9+
- ../../base/operator-controller/crd/standard
810
- ../../base/common
911
components:
1012
- ../../components/tls/catalogd
1113
- ../../components/tls/operator-controller
12-
- ../../components/coverage
13-
- ../../components/registries-conf
14+
- ../../components/e2e/coverage
15+
- ../../components/e2e/registries-conf
1416
# ca must be last or other components will overwrite the namespaces
1517
- ../../components/tls/ca

config/overlays/cert-manager/kustomization.yaml renamed to config/overlays/standard/kustomization.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ apiVersion: kustomize.config.k8s.io/v1beta1
44
kind: Kustomization
55
resources:
66
- ../../base/catalogd
7+
- ../../base/catalogd/crd/standard
78
- ../../base/operator-controller
9+
- ../../base/operator-controller/crd/standard
810
- ../../base/common
911
components:
1012
- ../../components/tls/catalogd

config/webhook/manifests.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)