Skip to content

Commit 002abfc

Browse files
committed
chore: Generated commit to update templated files since the last template run up to stackabletech/operator-templating@f376d41
Reference-to: stackabletech/operator-templating@f376d41 (docs: update the Stackable overview diagram)
1 parent 44c9980 commit 002abfc

8 files changed

Lines changed: 962 additions & 20 deletions

File tree

.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
-214 KB
Binary file not shown.
-11.4 KB
Loading

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)

deploy/helm/secret-operator/crds/crds.yaml

Lines changed: 937 additions & 0 deletions
Large diffs are not rendered by default.

deploy/helm/secret-operator/templates/service.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.maintenance.customResourceDefinitions.maintain }}
1+
22
---
33
apiVersion: v1
44
kind: Service
@@ -11,11 +11,9 @@ metadata:
1111
{{- include "operator.labels" . | nindent 4 }}
1212
spec:
1313
selector:
14-
webhook.stackable.tech/conversion: enabled
15-
{{- include "operator.selectorLabels" . | nindent 4 }}
14+
{{- include "operator.selectorLabels" . | nindent 6 }}
1615
ports:
1716
- name: conversion-webhook
1817
protocol: TCP
1918
port: 8443
2019
targetPort: 8443
21-
{{- end }}

scripts/run-tests

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import shutil
1111
import subprocess
1212
import sys
1313
import tempfile
14-
import time
1514

1615
__version__ = "0.0.1"
1716

@@ -452,7 +451,6 @@ def main(argv) -> int:
452451
gen_tests(opts.test_suite, opts.namespace, opts.work_dir)
453452
with release_file(opts.operator, opts.skip_operator) as f:
454453
maybe_install_release(opts.skip_release, f, opts.listener_class_preset)
455-
time.sleep(10)
456454
if opts.skip_tests:
457455
logging.info("Skip running tests.")
458456
else:

0 commit comments

Comments
 (0)