Skip to content

Commit c5fe8d7

Browse files
tests: pass on listener presets to stackablectl (#654)
chore: Generated commit to update templated files since the last template run up to stackabletech/operator-templating@9ef3004 Reference-to: stackabletech/operator-templating@9ef3004 (tests: pass on listener presets to stackablectl)
1 parent 6a7fb74 commit c5fe8d7

File tree

6 files changed

+978
-22
lines changed

6 files changed

+978
-22
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ result
1313
image.tar
1414

1515
tilt_options.json
16-
local_values.yaml
1716

1817
.direnv/
1918
.direnvrc

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ compile-chart: version crds config
105105

106106
chart-clean:
107107
rm -rf "deploy/helm/${OPERATOR_NAME}/configs"
108+
rm -rf "deploy/helm/${OPERATOR_NAME}/crds"
108109

109110
version:
110111
cat "deploy/helm/${OPERATOR_NAME}/Chart.yaml" | yq ".version = \"${VERSION}\" | .appVersion = \"${VERSION}\"" > "deploy/helm/${OPERATOR_NAME}/Chart.yaml.new"
@@ -116,11 +117,9 @@ config:
116117
cp -r deploy/config-spec/* "deploy/helm/${OPERATOR_NAME}/configs";\
117118
fi
118119

119-
# We generate a crds.yaml, so that the effect of code changes are visible.
120-
# The operator will take care of the CRD rollout itself.
121120
crds:
122-
mkdir -p extra
123-
cargo run --bin stackable-"${OPERATOR_NAME}" -- crd > extra/crds.yaml
121+
mkdir -p deploy/helm/"${OPERATOR_NAME}"/crds
122+
cargo run --bin stackable-"${OPERATOR_NAME}" -- crd | yq eval '.metadata.annotations["helm.sh/resource-policy"]="keep"' - > "deploy/helm/${OPERATOR_NAME}/crds/crds.yaml"
124123

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

Tiltfile

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ custom_build(
1717
outputs_image_ref_to='result/ref',
1818
)
1919

20+
# Load the latest CRDs from Nix
21+
watch_file('result')
22+
if os.path.exists('result'):
23+
k8s_yaml('result/crds.yaml')
24+
2025
# We need to set the correct image annotation on the operator Deployment to use e.g.
2126
# oci.stackable.tech/sandbox/opa-operator:7y19m3d8clwxlv34v5q2x4p7v536s00g instead of
2227
# oci.stackable.tech/sandbox/opa-operator:0.0.0-dev (which does not exist)
@@ -30,12 +35,18 @@ helm_values = settings.get('helm_values', None)
3035

3136
helm_override_image_repository = 'image.repository=' + registry + '/' + operator_name
3237

33-
k8s_yaml(helm(
34-
'deploy/helm/' + operator_name,
35-
name=operator_name,
36-
namespace="stackable-operators",
37-
set=[
38-
helm_override_image_repository,
39-
],
40-
values=helm_values,
41-
))
38+
# Exclude stale CRDs from Helm chart, and apply the rest
39+
helm_crds, helm_non_crds = filter_yaml(
40+
helm(
41+
'deploy/helm/' + operator_name,
42+
name=operator_name,
43+
namespace="stackable-operators",
44+
set=[
45+
helm_override_image_repository,
46+
],
47+
values=helm_values,
48+
),
49+
api_version = "^apiextensions\\.k8s\\.io/.*$",
50+
kind = "^CustomResourceDefinition$",
51+
)
52+
k8s_yaml(helm_non_crds)

0 commit comments

Comments
 (0)