Skip to content

Commit 121eb1a

Browse files
authored
The operator no longer installs the CRDs on start-up (#726)
1 parent 6aef84c commit 121eb1a

36 files changed

+437
-855
lines changed

.github/workflows/build.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,16 @@ jobs:
140140

141141
- name: E2E Remote Tests
142142
shell: bash
143-
run: make e2e-test
143+
run: |
144+
make undeploy
145+
make uninstall-crds
146+
make e2e-test
144147
145148
- name: Helm Chart Tests
146149
shell: bash
147150
run: |
151+
make undeploy
152+
make uninstall-crds
148153
make e2e-helm-test
149154
150155
- name: Upload Manifests

.github/workflows/istio-tests.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ jobs:
105105
sudo echo nameserver 8.8.8.8 > /run/systemd/resolve/stub-resolv.conf
106106
107107
- name: Start KinD Cluster
108-
# Start a KinD K8s cluster with single worker node
109108
shell: bash
110109
run: |
111110
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
@@ -119,7 +118,6 @@ jobs:
119118
make all
120119
121120
- name: Load Images to KinD
122-
# Load the images just built to the KinD cluster
123121
shell: bash
124122
run: |
125123
make kind-load
@@ -130,8 +128,9 @@ jobs:
130128
- name: Istio Tests
131129
shell: bash
132130
run: |
133-
make deploy
131+
make reset-namespace
134132
ISTIO_VERSION=${{ matrix.istioVersion }} make install-istio
133+
make deploy
135134
make e2e-client-test
136135
make e2e-test
137136
make undeploy

Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,13 +732,25 @@ $(BUILD_TARGETS)/java: $(JAVA_FILES)
732732
.PHONY: helm-chart
733733
helm-chart: $(BUILD_PROPS) $(BUILD_HELM)/coherence-operator-$(VERSION).tgz ## Build the Coherence Operator Helm chart
734734

735+
CRD_TEMPLATE := $(BUILD_HELM)/coherence-operator/templates/crd.yaml
735736
$(BUILD_HELM)/coherence-operator-$(VERSION).tgz: $(BUILD_PROPS) $(HELM_FILES) $(BUILD_TARGETS)/generate $(BUILD_TARGETS)/manifests $(TOOLS_BIN)/kustomize
736737
# Copy the Helm chart from the source location to the distribution folder
737-
-mkdir -p $(BUILD_HELM)
738+
-mkdir -p $(BUILD_HELM)/temp
738739
cp -R ./helm-charts/coherence-operator $(BUILD_HELM)
740+
$(KUSTOMIZE) build $(BUILD_DEPLOY)/overlays/helm -o $(BUILD_HELM)/temp
741+
rm $(CRD_TEMPLATE) || true
742+
echo "{{- if (eq .Values.installCrd true) }}" > $(CRD_TEMPLATE)
743+
cat $(BUILD_HELM)/temp/apiextensions.k8s.io_v1_customresourcedefinition_coherence.coherence.oracle.com.yaml >> $(CRD_TEMPLATE)
744+
printf "\n{{- if (eq .Values.allowCoherenceJobs true) }}\n" >> $(CRD_TEMPLATE)
745+
echo "---" >> $(CRD_TEMPLATE)
746+
cat $(BUILD_HELM)/temp/apiextensions.k8s.io_v1_customresourcedefinition_coherencejob.coherence.oracle.com.yaml >> $(CRD_TEMPLATE)
747+
echo "" >> $(CRD_TEMPLATE)
748+
echo "{{- end }}" >> $(CRD_TEMPLATE)
749+
echo "{{- end }}" >> $(CRD_TEMPLATE)
739750
$(call replaceprop,$(BUILD_HELM)/coherence-operator/Chart.yaml $(BUILD_HELM)/coherence-operator/values.yaml $(BUILD_HELM)/coherence-operator/templates/deployment.yaml $(BUILD_HELM)/coherence-operator/templates/rbac.yaml)
740751
helm lint $(BUILD_HELM)/coherence-operator
741752
helm package $(BUILD_HELM)/coherence-operator --destination $(BUILD_HELM)
753+
rm -rf $(BUILD_HELM)/temp
742754

743755
# ---------------------------------------------------------------------------
744756
# Do a search and replace of properties in selected files in the Helm charts.

api/v1/coherence_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,11 @@ type CoherenceUtilsSpec struct {
880880
// More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
881881
// +optional
882882
ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
883+
// Image is used to set the utils image used in Coherence Pods.
884+
//
885+
// Deprecated: This field is deprecated and no longer used, any value set will be ignored.
886+
// +optional
887+
Image *string `json:"image,omitempty"`
883888
}
884889

885890
// EnsureImage ensures that the image value is set.

api/v1/coherenceresource_utils.go

Lines changed: 0 additions & 157 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: kustomize.config.k8s.io/v1alpha1
2+
kind: Component
3+
4+
labels:
5+
- pairs:
6+
control-plane: coherence
7+
app.kubernetes.io/name: coherence-operator
8+
app.kubernetes.io/version: "3.5.0"
9+
app.kubernetes.io/part-of: coherence-operator
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
- op: add
22
path: /spec/template/spec/containers/0/args/-
33
value:
4-
- --install-job-crd=false
4+
- --enable-jobs=false

config/components/restricted/single-namespace-patch.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
- op: add
1313
path: /spec/template/spec/containers/0/args/-
1414
value: --enable-webhook=false
15-
- op: add
16-
path: /spec/template/spec/containers/0/args/-
17-
value: --install-crd=false
1815
- op: add
1916
path: /spec/template/spec/containers/0/args/-
2017
value: --node-lookup-enabled=false

config/manager/manager.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ spec:
6161
args:
6262
- operator
6363
- --enable-leader-election
64-
- --install-crd=false
6564
envFrom:
6665
- configMapRef:
6766
name: env-vars
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
resources:
5+
- ../../crd-small
6+
7+
components:
8+
- ../../components/helm

0 commit comments

Comments
 (0)