Skip to content

Commit f050355

Browse files
authored
Add experimental manifest (#2063)
This adds `manifests/experimental.yaml` The difference between the experimental manifest and the standard manifest is the presence of the experimental CRD vs the standard CRD (as of right now there is only a difference in annotations), and the feature-gated components. This change supports defining feature components in _exactly_ one place: * GA'd features are put into `components/base/common` * Feature-Gated/Experimental/TechPreview features are put into `components/base/experimental` This adds new components to make constructing the overlays easier: `components/base/common` includes everything but CRDs and experimental features: * `base/catalog` (but not CRDs) * `base/operator-controller` (but not CRDs) * `base/common` * GA'd features (currently none) `components/base/standard` adds the standard CRD: * `component/base/common` component * standard CRDs `components/base/experimental` includes the experimental CRDs and features: * `component/base/common` component * experimental CRDs * experimental (non-GA'd) features: - `components/features/synthetic-user-permissions` - `components/features/webhook-provider-certmanager` - `components/features/webhook-provider-openshift-serviceca` By necessity, this removes the crd from the `config/base/.../kustomization.yaml` files. These `kustomization.yaml` files define the namespace and prefix for resources, so we need to continue to reference them. Since the CRDs do not have a namespace, and do not use the prefix, the `crd` directory can be removed. Fix the basic-olm overlay to use the new standard component Add new `run-experimental` target, to run with the experimental manifest. This is part of the feature-gated API functionality. Signed-off-by: Todd Short <tshort@redhat.com>
1 parent 8228000 commit f050355

File tree

11 files changed

+1962
-17
lines changed

11 files changed

+1962
-17
lines changed

Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ endif
7373

7474
KUSTOMIZE_STANDARD_OVERLAY := config/overlays/standard
7575
KUSTOMIZE_STANDARD_E2E_OVERLAY := config/overlays/standard-e2e
76+
KUSTOMIZE_EXPERIMENTAL_OVERLAY := config/overlays/experimental
7677

7778
export RELEASE_MANIFEST := operator-controller.yaml
7879
export RELEASE_INSTALL := install.sh
@@ -82,6 +83,7 @@ export RELEASE_CATALOGS := default-catalogs.yaml
8283
MANIFEST_HOME := ./manifests
8384
STANDARD_MANIFEST := ./manifests/standard.yaml
8485
STANDARD_E2E_MANIFEST := ./manifests/standard-e2e.yaml
86+
EXPERIMENTAL_MANIFEST := ./manifests/experimental.yaml
8587
CATALOGS_MANIFEST := ./manifests/default-catalogs.yaml
8688

8789
# Manifest used by kind-deploy, which may be overridden by other targets
@@ -154,6 +156,7 @@ manifests: $(CONTROLLER_GEN) $(KUSTOMIZE) #EXHELP Generate WebhookConfiguration,
154156
mkdir -p $(MANIFEST_HOME)
155157
$(KUSTOMIZE) build $(KUSTOMIZE_STANDARD_OVERLAY) > $(STANDARD_MANIFEST)
156158
$(KUSTOMIZE) build $(KUSTOMIZE_STANDARD_E2E_OVERLAY) > $(STANDARD_E2E_MANIFEST)
159+
$(KUSTOMIZE) build $(KUSTOMIZE_EXPERIMENTAL_OVERLAY) > $(EXPERIMENTAL_MANIFEST)
157160

158161
.PHONY: generate
159162
generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -261,15 +264,15 @@ test-e2e: run image-registry prometheus e2e e2e-metrics e2e-coverage kind-clean
261264
.PHONY: prometheus
262265
prometheus: PROMETHEUS_NAMESPACE := olmv1-system
263266
prometheus: PROMETHEUS_VERSION := v0.83.0
264-
prometheus: #HELP Deploy Prometheus into specified namespace
267+
prometheus: #EXHELP Deploy Prometheus into specified namespace
265268
./hack/test/setup-monitoring.sh $(PROMETHEUS_NAMESPACE) $(PROMETHEUS_VERSION) $(KUSTOMIZE)
266269

267270
# The metrics.out file contains raw json data of the metrics collected during a test run.
268271
# In an upcoming PR, this query will be replaced with one that checks for alerts from
269272
# prometheus. Prometheus will gather metrics we currently query for over the test run,
270273
# and provide alerts from the metrics based on the rules that we set.
271274
.PHONY: e2e-metrics
272-
e2e-metrics: #HELP Request metrics from prometheus; place in ARTIFACT_PATH if set
275+
e2e-metrics: #EXHELP Request metrics from prometheus; place in ARTIFACT_PATH if set
273276
curl -X POST \
274277
-H "Content-Type: application/x-www-form-urlencoded" \
275278
--data 'query={pod=~"operator-controller-controller-manager-.*|catalogd-controller-manager-.*"}' \
@@ -384,6 +387,10 @@ go-build-linux: $(BINARIES)
384387
.PHONY: run
385388
run: docker-build kind-cluster kind-load kind-deploy wait #HELP Build the operator-controller then deploy it into a new kind cluster.
386389

390+
.PHONY: run-experimental
391+
run-experimental: SOURCE_MANIFEST := $(EXPERIMENTAL_MANIFEST)
392+
run-experimental: run #HELP Build the operator-controller then deploy it with the experimental manifest into a new kind cluster.
393+
387394
CATD_NAMESPACE := olmv1-system
388395
wait:
389396
kubectl wait --for=condition=Available --namespace=$(CATD_NAMESPACE) deployment/catalogd-controller-manager --timeout=60s
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
# Does not include the CRD, which must be added separately (it's non-namespaced)
12
apiVersion: kustomize.config.k8s.io/v1beta1
23
kind: Kustomization
34
namespace: olmv1-system
45
namePrefix: catalogd-
56
resources:
6-
- crd
77
- rbac
88
- manager
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
# Does not include the CRD, which must be added separately (it's non-namespaced)
12
apiVersion: kustomize.config.k8s.io/v1beta1
23
kind: Kustomization
34
namespace: olmv1-system
45
namePrefix: operator-controller-
56
resources:
6-
- crd
77
- rbac
88
- manager
9-
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: kustomize.config.k8s.io/v1alpha1
2+
kind: Component
3+
# resources contains the minimal required base, EXCEPT CRDs
4+
resources:
5+
- ../../../base/catalogd
6+
- ../../../base/operator-controller
7+
- ../../../base/common
8+
# components should include any GA'd features (none as of now)
9+
components:
10+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: kustomize.config.k8s.io/v1alpha1
2+
kind: Component
3+
# Pull in the experimental CRDs
4+
resources:
5+
- ../../../base/catalogd/crd/experimental
6+
- ../../../base/operator-controller/crd/experimental
7+
# Pull in the component(s) common to standard and experimental
8+
components:
9+
- ../common
10+
# EXPERIMENTAL FEATURES ARE LISTED HERE
11+
- ../../features/synthetic-user-permissions
12+
- ../../features/webhook-provider-certmanager
13+
- ../../features/webhook-provider-openshift-serviceca
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: kustomize.config.k8s.io/v1alpha1
2+
kind: Component
3+
# Pull in the standard CRDs
4+
resources:
5+
- ../../../base/catalogd/crd/standard
6+
- ../../../base/operator-controller/crd/standard
7+
# Pull in the component(s) common to standard and experimental
8+
components:
9+
- ../common
10+
# GA'D FEATURES ARE LISTED HERE

config/overlays/basic-olm/kustomization.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
# DO NOT ADD A NAMESPACE HERE
33
apiVersion: kustomize.config.k8s.io/v1beta1
44
kind: Kustomization
5-
resources:
6-
- ../../base/catalogd
7-
- ../../base/operator-controller
8-
- ../../base/common
5+
components:
6+
- ../../components/base/standard
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# kustomization file for secure OLMv1
2+
# DO NOT ADD A NAMESPACE HERE
3+
apiVersion: kustomize.config.k8s.io/v1beta1
4+
kind: Kustomization
5+
components:
6+
- ../../components/base/experimental
7+
# This must be last due to namespace overwrite issues of the ca
8+
- ../../components/cert-manager

config/overlays/standard-e2e/kustomization.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22
# DO NOT ADD A NAMESPACE HERE
33
apiVersion: kustomize.config.k8s.io/v1beta1
44
kind: Kustomization
5-
resources:
6-
- ../../base/catalogd
7-
- ../../base/operator-controller
8-
- ../../base/common
95
components:
6+
- ../../components/base/standard
107
- ../../components/e2e
118
# This must be last due to namespace overwrite issues of the ca
129
- ../../components/cert-manager

config/overlays/standard/kustomization.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
# DO NOT ADD A NAMESPACE HERE
33
apiVersion: kustomize.config.k8s.io/v1beta1
44
kind: Kustomization
5-
resources:
6-
- ../../base/catalogd
7-
- ../../base/operator-controller
8-
- ../../base/common
95
components:
6+
- ../../components/base/standard
107
# This must be last due to namespace overwrite issues of the ca
118
- ../../components/cert-manager

0 commit comments

Comments
 (0)