Skip to content

Commit 76d10b4

Browse files
authored
Fix broken makefile, adapt K8s manifests for STFU rework (#33)
* Fix broken makefile, adapt K8s manifests for STFU rework * Restore accidentally hardcoded reference to zookeeper * Revert to mikefarah's yq * Supply `run` default argument in Dockerfile * Allow patching objects
1 parent 3451442 commit 76d10b4

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

template/Makefile.j2

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# DON'T MANUALLY EDIT THIS FILE
44
# =============
55

6+
# This script requires https://github.com/mikefarah/yq (not to be confused with https://github.com/kislyuk/yq)
7+
# It is available from Nixpkgs as `yq-go` (`nix shell nixpkgs#yq-go`)
8+
69
.PHONY: docker chart-lint compile-chart
710

811
TAG := $(shell git rev-parse --short HEAD)
@@ -19,12 +22,12 @@ compile-chart: version crds config
1922

2023
chart-clean:
2124
rm -rf deploy/helm/{[ operator.product_string }]-operator/configs
25+
rm -rf deploy/helm/{[ operator.product_string }]-operator/crds
2226
rm -rf deploy/helm/{[ operator.product_string }]-operator/templates/crds.yaml
2327

2428
version:
2529
yq eval -i '.version = ${VERSION} | .appVersion = ${VERSION}' deploy/helm/{[ operator.product_string }]-operator/Chart.yaml
2630

27-
2831
config: deploy/helm/{[ operator.product_string }]-operator/configs
2932

3033
deploy/helm/{[ operator.product_string }]-operator/configs:
@@ -34,7 +37,7 @@ crds: deploy/helm/{[ operator.product_string }]-operator/crds/crds.yaml
3437

3538
deploy/helm/{[ operator.product_string }]-operator/crds/crds.yaml:
3639
mkdir -p deploy/helm/{[ operator.product_string }]-operator/crds
37-
cat deploy/crd/*.yaml | yq e '.metadata.annotations["helm.sh/resource-policy"]="keep"' - > ${@}
40+
cat deploy/crd/*.yaml | yq eval '.metadata.annotations["helm.sh/resource-policy"]="keep"' - > ${@}
3841

3942
chart-lint: compile-chart
4043
docker run -it -v $(shell pwd):/build/helm-charts -w /build/helm-charts quay.io/helmpack/chart-testing:v3.4.0 ct lint --config deploy/helm/chart_testing.yaml

template/deploy/helm/[[product]]-operator/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ spec:
5858
{{- with .Values.tolerations }}
5959
tolerations:
6060
{{- toYaml . | nindent 8 }}
61-
{{- end }}
61+
{{- end }}

template/deploy/helm/[[product]]-operator/templates/roles.yaml.j2

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,26 @@ rules:
7373
resources:
7474
- pods
7575
- configmaps
76+
- services
77+
- endpoints
7678
verbs:
7779
- create
7880
- delete
7981
- list
82+
- patch
83+
- update
8084
- watch
85+
- apiGroups:
86+
- apps
87+
resources:
88+
- statefulsets
89+
verbs:
90+
- create
91+
- delete
92+
- list
93+
- patch
8194
- update
95+
- watch
8296
- apiGroups:
8397
- batch
8498
resources:
@@ -87,6 +101,8 @@ rules:
87101
- create
88102
- get
89103
- list
104+
- patch
105+
- update
90106
- watch
91107
- apiGroups:
92108
- apiextensions.k8s.io
@@ -119,6 +135,9 @@ rules:
119135
- {{ include "operator.name" . }}.stackable.tech
120136
resources:
121137
- {{ include "operator.name" . }}clusters
138+
{[% if operator.product_string in ['zookeeper']%}]
139+
- {{ include "operator.name" . }}znode
140+
{[% endif %}]
122141
verbs:
123142
- get
124143
- list

template/docker/Dockerfile.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ RUN groupadd -g 1000 stackable && adduser -u 1000 -g stackable -c 'Stackable Ope
2323
USER 1000:1000
2424

2525
ENTRYPOINT ["/stackable-{[ operator.product_string }]-operator"]
26+
CMD ["run"]

0 commit comments

Comments
 (0)