|
| 1 | +# Current Operator version |
| 2 | +VERSION ?= 0.0.1 |
| 3 | +# Default bundle image tag |
| 4 | +BUNDLE_IMG ?= controller-bundle:$(VERSION) |
| 5 | +# Options for 'bundle-build' |
| 6 | +ifneq ($(origin CHANNELS), undefined) |
| 7 | +BUNDLE_CHANNELS := --channels=$(CHANNELS) |
| 8 | +endif |
| 9 | +ifneq ($(origin DEFAULT_CHANNEL), undefined) |
| 10 | +BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL) |
| 11 | +endif |
| 12 | +BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL) |
1 | 13 |
|
2 | 14 | # Image URL to use all building/pushing image targets |
3 | 15 | IMG ?= controller:latest |
@@ -35,7 +47,7 @@ uninstall: manifests kustomize |
35 | 47 |
|
36 | 48 | # Deploy controller in the configured Kubernetes cluster in ~/.kube/config |
37 | 49 | deploy: manifests kustomize |
38 | | - cd config/manager && kustomize edit set image controller=${IMG} |
| 50 | + cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} |
39 | 51 | $(KUSTOMIZE) build config/default | kubectl apply -f - |
40 | 52 |
|
41 | 53 | # UnDeploy controller from the configured Kubernetes cluster in ~/.kube/config |
@@ -99,3 +111,13 @@ KUSTOMIZE=$(GOBIN)/kustomize |
99 | 111 | else |
100 | 112 | KUSTOMIZE=$(shell which kustomize) |
101 | 113 | endif |
| 114 | + |
| 115 | +# Generate bundle manifests and metadata, then validate generated files. |
| 116 | +bundle: manifests |
| 117 | + operator-sdk generate kustomize manifests -q |
| 118 | + kustomize build config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS) |
| 119 | + operator-sdk bundle validate ./bundle |
| 120 | + |
| 121 | +# Build the bundle image. |
| 122 | +bundle-build: |
| 123 | + docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) . |
0 commit comments