Skip to content

Commit 1b98699

Browse files
committed
fix manifest generation
Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
1 parent 2b76a84 commit 1b98699

7 files changed

+41
-31
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ coverage
1919
cover.out
2020

2121
# Release output
22-
dist/**
23-
install.sh
22+
/dist/**
23+
/operator-controller.yaml
24+
/default-catalogs.yaml
25+
/install.sh
2426

2527
# vendored files
2628
vendor/

.goreleaser.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ release:
124124
disable: '{{ ne .Env.ENABLE_RELEASE_PIPELINE "true" }}'
125125
mode: replace
126126
extra_files:
127-
- glob: 'operator-controller.yaml'
128-
- glob: './config/catalogs/clustercatalogs/default-catalogs.yaml'
129-
- glob: 'install.sh'
127+
- glob: '{{ .Env.RELEASE_MANIFEST }}'
128+
- glob: '{{ .Env.RELEASE_INSTALL }}'
129+
- glob: '{{ .Env.RELEASE_CATALOGS }}'
130130
header: |
131131
## Installation
132132

Makefile

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,15 @@ KUSTOMIZE_E2E_OVERLAY := config/overlays/community-e2e
9292
KUSTOMIZE_TILT_OVERLAY := config/overlays/community-tilt
9393
KUSTOMIZE_CATALOGS_OVERLAY := config/overlays/default-catalogs
9494

95-
RELEASE_MANIFEST := ./release-manifests/operator-controller.yaml
96-
E2E_MANIFEST := ./release-manifests/operator-controller-e2e.yaml
97-
TILT_MANIFEST := ./release-manifests/operator-controller-tilt.yaml
98-
CATALOGS_MANIFEST := ./release-manifests/default-catalogs.yaml
95+
export RELEASE_MANIFEST := operator-controller.yaml
96+
export RELEASE_INSTALL := install.sh
97+
export RELEASE_CATALOGS := default-catalogs.yaml
98+
99+
DEV_MANIFESTS_DIR := dev-manifests
100+
DEV_MANIFEST := $(DEV_MANIFESTS_DIR)/operator-controller-dev.yaml
101+
E2E_MANIFEST := $(DEV_MANIFESTS_DIR)/operator-controller-e2e.yaml
102+
TILT_MANIFEST := $(DEV_MANIFESTS_DIR)/operator-controller-tilt.yaml
103+
CATALOGS_MANIFEST := $(DEV_MANIFESTS_DIR)/default-catalogs.yaml
99104

100105
# Disable -j flag for make
101106
.NOTPARALLEL:
@@ -165,9 +170,10 @@ manifests: $(CONTROLLER_GEN) $(KUSTOMIZE) #EXHELP Generate WebhookConfiguration,
165170
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) rbac:roleName=manager-role paths="./internal/operator-controller/..." output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)
166171
# Generate the remaining catalogd manifests
167172
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) rbac:roleName=manager-role paths="./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR)
168-
$(KUSTOMIZE) build $(KUSTOMIZE_RELEASE_OVERLAY) | envsubst '$$VERSION' > $(RELEASE_MANIFEST)
169-
$(KUSTOMIZE) build $(KUSTOMIZE_E2E_OVERLAY) | envsubst '$$VERSION' > $(E2E_MANIFEST)
170-
$(KUSTOMIZE) build $(KUSTOMIZE_TILT_OVERLAY) | envsubst '$$VERSION' > $(TILT_MANIFEST)
173+
mkdir -p $(DEV_MANIFESTS_DIR)
174+
$(KUSTOMIZE) build $(KUSTOMIZE_RELEASE_OVERLAY) > $(DEV_MANIFEST)
175+
$(KUSTOMIZE) build $(KUSTOMIZE_E2E_OVERLAY) > $(E2E_MANIFEST)
176+
$(KUSTOMIZE) build $(KUSTOMIZE_TILT_OVERLAY) > $(TILT_MANIFEST)
171177
$(KUSTOMIZE) build $(KUSTOMIZE_CATALOGS_OVERLAY) > $(CATALOGS_MANIFEST)
172178

173179

@@ -303,9 +309,9 @@ kind-load: $(KIND) #EXHELP Loads the currently constructed images into the KIND
303309
$(CONTAINER_RUNTIME) save $(CATD_IMG) | $(KIND) load image-archive /dev/stdin --name $(KIND_CLUSTER_NAME)
304310

305311
.PHONY: kind-deploy
306-
kind-deploy: export DEFAULT_CATALOGS := $(CATALOGS_MANIFEST)
307312
kind-deploy: manifests $(KUSTOMIZE)
308-
envsubst '$$DEFAULT_CATALOGS,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh | bash -s
313+
envsubst '$$VERSION' < $$MANIFEST > ./tmp-manifest.yaml
314+
export MANIFEST=./tmp-manifest.yaml && envsubst '$$DEFAULT_CATALOGS,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh | bash -s && rm ./tmp-manifest.yaml
309315

310316
.PHONY: kind-cluster
311317
kind-cluster: $(KIND) #EXHELP Standup a kind cluster.
@@ -356,7 +362,7 @@ go-build-linux: export GOARCH=amd64
356362
go-build-linux: $(BINARIES)
357363

358364
.PHONY: run
359-
run: export MANIFEST := $(RELEASE_MANIFEST)
365+
run: export MANIFEST := $(DEV_MANIFEST)
360366
run: run-internal #HELP Build the operator-controller then deploy it into a new kind cluster.
361367

362368
.PHONY: run-internal
@@ -391,7 +397,9 @@ release: $(GORELEASER) #EXHELP Runs goreleaser for the operator-controller. By d
391397
quickstart: export MANIFEST := https://github.com/operator-framework/operator-controller/releases/download/$(VERSION)/operator-controller.yaml
392398
quickstart: export DEFAULT_CATALOGS := "https://github.com/operator-framework/operator-controller/releases/download/$(VERSION)/default-catalogs.yaml"
393399
quickstart: manifests #EXHELP Generate the unified installation release manifests and scripts.
394-
envsubst '$$DEFAULT_CATALOGS,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh > install.sh
400+
envsubst '$$VERSION' < $(DEV_MANIFEST) > $(RELEASE_MANIFEST)
401+
cp $(CATALOGS_MANIFEST) > $(RELEASE_CATALOGS)
402+
envsubst '$$DEFAULT_CATALOGS,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh > $(RELEASE_INSTALL)
395403

396404
##@ Docs
397405

release-manifests/operator-controller.yaml renamed to dev-manifests/operator-controller-dev.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,7 @@ spec:
15821582
valueFrom:
15831583
fieldRef:
15841584
fieldPath: metadata.namespace
1585-
image: quay.io/operator-framework/catalogd:v1.2.0-54-ged662040
1585+
image: quay.io/operator-framework/catalogd:${VERSION}
15861586
imagePullPolicy: IfNotPresent
15871587
livenessProbe:
15881588
httpGet:
@@ -1629,7 +1629,7 @@ spec:
16291629
- key: tls.key
16301630
path: tls.key
16311631
optional: false
1632-
secretName: catalogd-cert-v1.2.0-54-ged662040
1632+
secretName: catalogd-cert-${VERSION}
16331633
---
16341634
apiVersion: apps/v1
16351635
kind: Deployment
@@ -1680,7 +1680,7 @@ spec:
16801680
- --catalogd-cas-dir=/var/certs/catalogd-ca
16811681
command:
16821682
- /operator-controller
1683-
image: quay.io/operator-framework/operator-controller:v1.2.0-54-ged662040
1683+
image: quay.io/operator-framework/operator-controller:${VERSION}
16841684
imagePullPolicy: IfNotPresent
16851685
livenessProbe:
16861686
httpGet:
@@ -1738,7 +1738,7 @@ spec:
17381738
- key: ca.crt
17391739
path: ca.crt
17401740
optional: false
1741-
secretName: catalogd-cert-v1.2.0-54-ged662040
1741+
secretName: catalogd-cert-${VERSION}
17421742
---
17431743
apiVersion: cert-manager.io/v1
17441744
kind: Certificate
@@ -1758,7 +1758,7 @@ spec:
17581758
privateKey:
17591759
algorithm: ECDSA
17601760
size: 256
1761-
secretName: catalogd-cert-v1.2.0-54-ged662040
1761+
secretName: catalogd-cert-${VERSION}
17621762
---
17631763
apiVersion: cert-manager.io/v1
17641764
kind: Certificate

release-manifests/operator-controller-e2e.yaml renamed to dev-manifests/operator-controller-e2e.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,7 +1626,7 @@ spec:
16261626
valueFrom:
16271627
fieldRef:
16281628
fieldPath: metadata.namespace
1629-
image: quay.io/operator-framework/catalogd:v1.2.0-54-ged662040
1629+
image: quay.io/operator-framework/catalogd:${VERSION}
16301630
imagePullPolicy: IfNotPresent
16311631
livenessProbe:
16321632
httpGet:
@@ -1676,7 +1676,7 @@ spec:
16761676
- key: tls.key
16771677
path: tls.key
16781678
optional: false
1679-
secretName: catalogd-cert-v1.2.0-54-ged662040
1679+
secretName: catalogd-cert-${VERSION}
16801680
- name: e2e-registry-ca
16811681
secret:
16821682
items:
@@ -1738,7 +1738,7 @@ spec:
17381738
env:
17391739
- name: GOCOVERDIR
17401740
value: /e2e-coverage
1741-
image: quay.io/operator-framework/operator-controller:v1.2.0-54-ged662040
1741+
image: quay.io/operator-framework/operator-controller:${VERSION}
17421742
imagePullPolicy: IfNotPresent
17431743
livenessProbe:
17441744
httpGet:
@@ -1804,7 +1804,7 @@ spec:
18041804
- key: ca.crt
18051805
path: ca.crt
18061806
optional: false
1807-
secretName: catalogd-cert-v1.2.0-54-ged662040
1807+
secretName: catalogd-cert-${VERSION}
18081808
- name: e2e-registry-ca
18091809
secret:
18101810
items:
@@ -1893,7 +1893,7 @@ spec:
18931893
privateKey:
18941894
algorithm: ECDSA
18951895
size: 256
1896-
secretName: catalogd-cert-v1.2.0-54-ged662040
1896+
secretName: catalogd-cert-${VERSION}
18971897
---
18981898
apiVersion: cert-manager.io/v1
18991899
kind: Certificate

release-manifests/operator-controller-tilt.yaml renamed to dev-manifests/operator-controller-tilt.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,7 +1581,7 @@ spec:
15811581
valueFrom:
15821582
fieldRef:
15831583
fieldPath: metadata.namespace
1584-
image: quay.io/operator-framework/catalogd:v1.2.0-54-ged662040
1584+
image: quay.io/operator-framework/catalogd:${VERSION}
15851585
imagePullPolicy: IfNotPresent
15861586
livenessProbe: null
15871587
name: manager
@@ -1618,7 +1618,7 @@ spec:
16181618
- key: tls.key
16191619
path: tls.key
16201620
optional: false
1621-
secretName: catalogd-cert-v1.2.0-54-ged662040
1621+
secretName: catalogd-cert-${VERSION}
16221622
---
16231623
apiVersion: apps/v1
16241624
kind: Deployment
@@ -1668,7 +1668,7 @@ spec:
16681668
- --catalogd-cas-dir=/var/certs/catalogd-ca
16691669
command:
16701670
- /operator-controller
1671-
image: quay.io/operator-framework/operator-controller:v1.2.0-54-ged662040
1671+
image: quay.io/operator-framework/operator-controller:${VERSION}
16721672
imagePullPolicy: IfNotPresent
16731673
livenessProbe: null
16741674
name: manager
@@ -1716,7 +1716,7 @@ spec:
17161716
- key: ca.crt
17171717
path: ca.crt
17181718
optional: false
1719-
secretName: catalogd-cert-v1.2.0-54-ged662040
1719+
secretName: catalogd-cert-${VERSION}
17201720
---
17211721
apiVersion: cert-manager.io/v1
17221722
kind: Certificate
@@ -1736,7 +1736,7 @@ spec:
17361736
privateKey:
17371737
algorithm: ECDSA
17381738
size: 256
1739-
secretName: catalogd-cert-v1.2.0-54-ged662040
1739+
secretName: catalogd-cert-${VERSION}
17401740
---
17411741
apiVersion: cert-manager.io/v1
17421742
kind: Certificate

0 commit comments

Comments
 (0)