Skip to content

Commit 2db6da3

Browse files
committed
fix: Partially revert changes from #654
1 parent d7c3aa6 commit 2db6da3

File tree

7 files changed

+35
-977
lines changed

7 files changed

+35
-977
lines changed

.gitignore

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

1515
tilt_options.json
16+
local_values.yaml
1617

1718
.direnv/
1819
.direnvrc

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ 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"
109108

110109
version:
111110
cat "deploy/helm/${OPERATOR_NAME}/Chart.yaml" | yq ".version = \"${VERSION}\" | .appVersion = \"${VERSION}\"" > "deploy/helm/${OPERATOR_NAME}/Chart.yaml.new"
@@ -117,9 +116,11 @@ config:
117116
cp -r deploy/config-spec/* "deploy/helm/${OPERATOR_NAME}/configs";\
118117
fi
119118

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.
120121
crds:
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"
122+
mkdir -p extra
123+
cargo run --bin stackable-"${OPERATOR_NAME}" -- crd > extra/crds.yaml
123124

124125
chart-lint: compile-chart
125126
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/secret-operator/crds/crds.yaml

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

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

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

extra/crds.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ spec:
2121
properties:
2222
spec:
2323
description: |-
24-
A [SecretClass](https://docs.stackable.tech/home/nightly/secret-operator/secretclass) is a cluster-global Kubernetes resource
24+
A [SecretClass](https://docs.stackable.tech/home/25.11/secret-operator/secretclass) is a cluster-global Kubernetes resource
2525
that defines a category of secrets that the Secret Operator knows how to provision.
2626
properties:
2727
backend:
2828
description: |-
2929
Each SecretClass is associated with a single
30-
[backend](https://docs.stackable.tech/home/nightly/secret-operator/secretclass#backend),
30+
[backend](https://docs.stackable.tech/home/25.11/secret-operator/secretclass#backend),
3131
which dictates the mechanism for issuing that kind of Secret.
3232
oneOf:
3333
- required:
@@ -41,7 +41,7 @@ spec:
4141
properties:
4242
autoTls:
4343
description: |-
44-
The [`autoTls` backend](https://docs.stackable.tech/home/nightly/secret-operator/secretclass#backend-autotls)
44+
The [`autoTls` backend](https://docs.stackable.tech/home/25.11/secret-operator/secretclass#backend-autotls)
4545
issues a TLS certificate signed by the Secret Operator.
4646
The certificate authority can be provided by the administrator, or managed automatically by the Secret Operator.
4747
@@ -198,7 +198,7 @@ spec:
198198
A new certificate will be requested the first time it is used by a Pod, it
199199
will be reused after that (subject to cert-manager renewal rules).
200200
201-
[1]: https://docs.stackable.tech/home/nightly/secret-operator/secretclass#backend-certmanager
201+
[1]: https://docs.stackable.tech/home/25.11/secret-operator/secretclass#backend-certmanager
202202
[cert-manager]: https://cert-manager.io/
203203
properties:
204204
defaultCertificateLifetime:
@@ -258,7 +258,7 @@ spec:
258258
type: object
259259
k8sSearch:
260260
description: |-
261-
The [`k8sSearch` backend](https://docs.stackable.tech/home/nightly/secret-operator/secretclass#backend-k8ssearch)
261+
The [`k8sSearch` backend](https://docs.stackable.tech/home/25.11/secret-operator/secretclass#backend-k8ssearch)
262262
can be used to mount Secrets across namespaces into Pods.
263263
properties:
264264
searchNamespace:
@@ -294,7 +294,7 @@ spec:
294294
type: object
295295
kerberosKeytab:
296296
description: |-
297-
The [`kerberosKeytab` backend](https://docs.stackable.tech/home/nightly/secret-operator/secretclass#backend-kerberoskeytab)
297+
The [`kerberosKeytab` backend](https://docs.stackable.tech/home/25.11/secret-operator/secretclass#backend-kerberoskeytab)
298298
creates a Kerberos keytab file for a selected realm.
299299
The Kerberos KDC and administrator credentials must be provided by the administrator.
300300
properties:
@@ -448,13 +448,13 @@ spec:
448448
properties:
449449
spec:
450450
description: |-
451-
A [SecretClass](https://docs.stackable.tech/home/nightly/secret-operator/secretclass) is a cluster-global Kubernetes resource
451+
A [SecretClass](https://docs.stackable.tech/home/25.11/secret-operator/secretclass) is a cluster-global Kubernetes resource
452452
that defines a category of secrets that the Secret Operator knows how to provision.
453453
properties:
454454
backend:
455455
description: |-
456456
Each SecretClass is associated with a single
457-
[backend](https://docs.stackable.tech/home/nightly/secret-operator/secretclass#backend),
457+
[backend](https://docs.stackable.tech/home/25.11/secret-operator/secretclass#backend),
458458
which dictates the mechanism for issuing that kind of Secret.
459459
oneOf:
460460
- required:
@@ -468,7 +468,7 @@ spec:
468468
properties:
469469
autoTls:
470470
description: |-
471-
The [`autoTls` backend](https://docs.stackable.tech/home/nightly/secret-operator/secretclass#backend-autotls)
471+
The [`autoTls` backend](https://docs.stackable.tech/home/25.11/secret-operator/secretclass#backend-autotls)
472472
issues a TLS certificate signed by the Secret Operator.
473473
The certificate authority can be provided by the administrator, or managed automatically by the Secret Operator.
474474
@@ -625,7 +625,7 @@ spec:
625625
A new certificate will be requested the first time it is used by a Pod, it
626626
will be reused after that (subject to cert-manager renewal rules).
627627
628-
[1]: https://docs.stackable.tech/home/nightly/secret-operator/secretclass#backend-certmanager
628+
[1]: https://docs.stackable.tech/home/25.11/secret-operator/secretclass#backend-certmanager
629629
[cert-manager]: https://cert-manager.io/
630630
properties:
631631
defaultCertificateLifetime:
@@ -685,7 +685,7 @@ spec:
685685
type: object
686686
k8sSearch:
687687
description: |-
688-
The [`k8sSearch` backend](https://docs.stackable.tech/home/nightly/secret-operator/secretclass#backend-k8ssearch)
688+
The [`k8sSearch` backend](https://docs.stackable.tech/home/25.11/secret-operator/secretclass#backend-k8ssearch)
689689
can be used to mount Secrets across namespaces into Pods.
690690
properties:
691691
searchNamespace:
@@ -721,7 +721,7 @@ spec:
721721
type: object
722722
kerberosKeytab:
723723
description: |-
724-
The [`kerberosKeytab` backend](https://docs.stackable.tech/home/nightly/secret-operator/secretclass#backend-kerberoskeytab)
724+
The [`kerberosKeytab` backend](https://docs.stackable.tech/home/25.11/secret-operator/secretclass#backend-kerberoskeytab)
725725
creates a Kerberos keytab file for a selected realm.
726726
The Kerberos KDC and administrator credentials must be provided by the administrator.
727727
properties:
@@ -890,13 +890,13 @@ spec:
890890
properties:
891891
spec:
892892
description: |-
893-
A [TrustStore](https://docs.stackable.tech/home/nightly/secret-operator/truststore) requests information about how to
894-
validate secrets issued by a [SecretClass](https://docs.stackable.tech/home/nightly/secret-operator/secretclass).
893+
A [TrustStore](https://docs.stackable.tech/home/25.11/secret-operator/truststore) requests information about how to
894+
validate secrets issued by a [SecretClass](https://docs.stackable.tech/home/25.11/secret-operator/secretclass).
895895
896896
The requested information is written to a ConfigMap with the same name as the TrustStore.
897897
properties:
898898
format:
899-
description: The [format](https://docs.stackable.tech/home/nightly/secret-operator/secretclass#format) that the data should be converted into.
899+
description: The [format](https://docs.stackable.tech/home/25.11/secret-operator/secretclass#format) that the data should be converted into.
900900
enum:
901901
- tls-pem
902902
- tls-pkcs12

scripts/run-tests

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

1516
__version__ = "0.0.1"
1617

@@ -451,6 +452,7 @@ def main(argv) -> int:
451452
gen_tests(opts.test_suite, opts.namespace, opts.work_dir)
452453
with release_file(opts.operator, opts.skip_operator) as f:
453454
maybe_install_release(opts.skip_release, f, opts.listener_class_preset)
455+
time.sleep(10)
454456
if opts.skip_tests:
455457
logging.info("Skip running tests.")
456458
else:

0 commit comments

Comments
 (0)