Skip to content

Commit b0e1df2

Browse files
committed
fix: revert "refactor:crd deployment (#952)"
This reverts commit a6bd2a4.
1 parent 2185273 commit b0e1df2

6 files changed

Lines changed: 17 additions & 2 deletions

File tree

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ all: build
9090
# More info on the awk command:
9191
# http://linuxcommand.org/lc3_adv_awk.php
9292

93-
HELM_CRD_TEMPLATE ?= helm-chart/amalthea-sessions/crds/amaltheasession.yaml
93+
HELM_CRD_TEMPLATE ?= helm-chart/amalthea-sessions/templates/amaltheasession-crd.yaml
9494

9595
.PHONY: help
9696
help: ## Display this help.
@@ -101,8 +101,10 @@ help: ## Display this help.
101101
.PHONY: manifests
102102
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
103103
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
104-
echo "# This manifest is auto-generated from the makefile do not edit manually." > $(HELM_CRD_TEMPLATE)
104+
echo "{{- if .Values.deployCrd -}}" > $(HELM_CRD_TEMPLATE)
105+
echo "# This manifest is auto-generated from the makefile do not edit manually." >> $(HELM_CRD_TEMPLATE)
105106
cat config/crd/bases/*yaml >> $(HELM_CRD_TEMPLATE)
107+
echo "{{- end }}" >> $(HELM_CRD_TEMPLATE)
106108

107109
.PHONY: generate
108110
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.

helm-chart/amalthea-sessions/crds/amaltheasession.yaml renamed to helm-chart/amalthea-sessions/templates/amaltheasession-crd.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.deployCrd -}}
12
# This manifest is auto-generated from the makefile do not edit manually.
23
---
34
apiVersion: apiextensions.k8s.io/v1
@@ -6496,3 +6497,4 @@ spec:
64966497
storage: true
64976498
subresources:
64986499
status: {}
6500+
{{- end }}

helm-chart/amalthea-sessions/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ controllerManager:
2525
kubernetesClusterDomain: cluster.local
2626
# If set to true then the operator will watch and operate in all namespaces
2727
clusterScoped: false
28+
# Whether to install the CRD
29+
deployCrd: true
2830
# Whether to install the dependencies or not
2931
deploy:
3032
csiRclone: false

helm-chart/amalthea/crds/jupyterserver.yaml renamed to helm-chart/amalthea/templates/crd.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.deployCrd -}}
12
# This manifest is auto-generated from controller/crds/jupyter_server.yaml, do not modify.
23
apiVersion: apiextensions.k8s.io/v1
34
kind: CustomResourceDefinition
@@ -306,3 +307,4 @@ spec:
306307
default:
307308
children: {}
308309
mainPod: {}
310+
{{- end }}

helm-chart/amalthea/values.schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@
6666
},
6767
"type": "object"
6868
},
69+
"deployCrd": {
70+
"description": "Should the helm chart apply the k8s CRD.",
71+
"type": "boolean"
72+
},
6973
"networkPolicies": {
7074
"description": "Enable and configure network policies for the controller and jupyter servers.",
7175
"type": "object",
@@ -432,6 +436,7 @@
432436
},
433437
"required": [
434438
"scope",
439+
"deployCrd",
435440
"networkPolicies",
436441
"kopf",
437442
"extraChildResources",

helm-chart/amalthea/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ scope:
3535
# will only operate in the namespace where the helm chart is deployed.
3636
# namespaces: ["default"]
3737

38+
deployCrd: true # whether to deploy the jupyterserver CRD
39+
3840
networkPolicies:
3941
# # Enable sensible, default network policies. Note that until cluster-wide
4042
# # network policies are available in Kubernetes (https://github.com/kubernetes/enhancements/issues/2091),

0 commit comments

Comments
 (0)