Skip to content

Commit 06c82fb

Browse files
committed
chore: Generated commit to update templated files since the last template run up to stackabletech/operator-templating@0fd2a1f
Reference-to: stackabletech/operator-templating@0fd2a1f (Rollout CRD versioning related changes and Nix fix)
1 parent de5af19 commit 06c82fb

7 files changed

Lines changed: 735 additions & 742 deletions

File tree

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ config:
4444
cp -r deploy/config-spec/* "deploy/helm/${OPERATOR_NAME}/configs";\
4545
fi
4646

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

5153
chart-lint: compile-chart
5254
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: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ 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-
2520
# We need to set the correct image annotation on the operator Deployment to use e.g.
2621
# oci.stackable.tech/sandbox/opa-operator:7y19m3d8clwxlv34v5q2x4p7v536s00g instead of
2722
# oci.stackable.tech/sandbox/opa-operator:0.0.0-dev (which does not exist)
@@ -35,18 +30,12 @@ helm_values = settings.get('helm_values', None)
3530

3631
helm_override_image_repository = 'image.repository=' + registry + '/' + operator_name
3732

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)
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+
))

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

Lines changed: 0 additions & 716 deletions
This file was deleted.

deploy/helm/commons-operator/templates/deployment.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ spec:
2121
{{- toYaml . | nindent 8 }}
2222
{{- end }}
2323
labels:
24+
{{- if .Values.maintenance.customResourceDefinitions.maintain }}
25+
webhook.stackable.tech/conversion: enabled
26+
{{- end }}
2427
{{- include "operator.selectorLabels" . | nindent 8 }}
2528
spec:
2629
{{- with .Values.image.pullSecrets }}
@@ -78,7 +81,9 @@ spec:
7881
- name: KUBERNETES_CLUSTER_DOMAIN
7982
value: {{ .Values.kubernetesClusterDomain | quote }}
8083
{{- end }}
84+
8185
{{- include "telemetry.envVars" . | nindent 12 }}
86+
{{- include "maintenance.envVars" . | nindent 12 }}
8287
volumes:
8388
- name: config-spec
8489
configMap:

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ metadata:
1111
{{- include "operator.labels" . | nindent 4 }}
1212
spec:
1313
selector:
14-
{{- include "operator.selectorLabels" . | nindent 6 }}
14+
{{- if .Values.maintenance.customResourceDefinitions.maintain }}
15+
webhook.stackable.tech/conversion: enabled
16+
{{- end }}
17+
{{- include "operator.selectorLabels" . | nindent 4 }}
1518
ports:
1619
- name: conversion-webhook
1720
protocol: TCP

extra/crds.yaml

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

shell.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ in pkgs.mkShell rec {
2121
];
2222

2323
# derivation runtime dependencies
24-
buildInputs = pkgs.lib.concatMap (crate: crate.buildInputs) cargoDependencySet;
24+
buildInputs = pkgs.lib.unique (pkgs.lib.concatMap (crate: crate.buildInputs) cargoDependencySet);
2525

2626
# build time dependencies
27-
nativeBuildInputs = pkgs.lib.concatMap (crate: crate.nativeBuildInputs) cargoDependencySet ++ (with pkgs; [
27+
nativeBuildInputs = pkgs.lib.unique (pkgs.lib.concatMap (crate: crate.nativeBuildInputs) cargoDependencySet ++ (with pkgs; [
2828
beku
2929
docker
3030
gettext # for the proper envsubst
@@ -38,7 +38,7 @@ in pkgs.mkShell rec {
3838
# tilt already defined in default.nix
3939
which
4040
yq-go
41-
]);
41+
]));
4242

4343
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
4444
BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.glibc.dev}/include -I${pkgs.clang}/resource-root/include";

0 commit comments

Comments
 (0)