Skip to content

Commit d99fb59

Browse files
authored
chore: Prepare CRD versioning (#400)
* chore: Move crds.yaml file * chore(helm): Adjust template files * feat: Add conversion webhook * chore: Add changelog entry
1 parent de5af19 commit d99fb59

14 files changed

Lines changed: 846 additions & 936 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Added
8+
9+
- Add conversion webhook ([#400]).
10+
711
### Changed
812

913
- Gracefully shutdown all concurrent tasks by forwarding the SIGTERM signal ([#396]).
@@ -18,6 +22,7 @@ All notable changes to this project will be documented in this file.
1822

1923
[#387]: https://github.com/stackabletech/commons-operator/pull/387
2024
[#396]: https://github.com/stackabletech/commons-operator/pull/396
25+
[#400]: https://github.com/stackabletech/commons-operator/pull/400
2126

2227
## [25.11.0] - 2025-11-07
2328

Makefile

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

3333
chart-clean:
3434
rm -rf "deploy/helm/${OPERATOR_NAME}/configs"
35-
rm -rf "deploy/helm/${OPERATOR_NAME}/crds"
3635

3736
version:
3837
cat "deploy/helm/${OPERATOR_NAME}/Chart.yaml" | yq ".version = \"${VERSION}\" | .appVersion = \"${VERSION}\"" > "deploy/helm/${OPERATOR_NAME}/Chart.yaml.new"
@@ -44,9 +43,11 @@ config:
4443
cp -r deploy/config-spec/* "deploy/helm/${OPERATOR_NAME}/configs";\
4544
fi
4645

46+
# We generate a crds.yaml, so that the effect of code changes are visible.
47+
# The operator will take care of the CRD rollout itself.
4748
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"
49+
mkdir -p extra
50+
cargo run --bin stackable-"${OPERATOR_NAME}" -- crd > extra/crds.yaml
5051

5152
chart-lint: compile-chart
5253
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/crd/authentication.crd.yaml

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

0 commit comments

Comments
 (0)