Skip to content

Commit 9086bc3

Browse files
committed
Merge branch '2762-stackgres-operator-helm-chart-and-argocd' into 'main'
fix: wrong original SGStream service path in webhooks, avoid setting caBundle in webhooks, follow webhooks original ordering, avoid usage of nullable in CRDs Closes #2762 See merge request ongresinc/stackgres!1655
2 parents 7d75468 + 951700c commit 9086bc3

9 files changed

Lines changed: 10235 additions & 182 deletions

File tree

stackgres-k8s/e2e/resources/knative-v1.17.0.yaml

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

stackgres-k8s/e2e/spec/stream-to-pglambda

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ e2e_test_install() {
1919
return
2020
fi
2121

22+
if ! docker manifest inspect "$PGLAMBDA_JAVASCRIPT_IMAGE_NAME" > /dev/null 2>&1
23+
then
24+
docker push "$PGLAMBDA_JAVASCRIPT_IMAGE_NAME"
25+
fi
26+
2227
k8s_cleanup_namespace "$OPERATOR_NAMESPACE"
2328
k8s_async_cleanup
2429

stackgres-k8s/e2e/utils/knative

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ knative_url() {
1313

1414
uninstall_knative() {
1515
sed 's/namespace: knative-operator/namespace: $(knative_namespace)/g' \
16-
"$E2E_PATH/knative-operator-v1.14.1.yaml" | kubectl delete --ignore-not-found -f -
16+
"$E2E_PATH/knative-v1.17.0.yaml" | kubectl delete --ignore-not-found -f -
1717
}
1818

1919
install_knative() {
@@ -47,7 +47,7 @@ install_knative() {
4747
fi
4848
kubectl create ns "$(knative_namespace)"
4949
sed "s/ namespace: .*$/ namespace: $(knative_namespace)/g" \
50-
"$E2E_PATH/resources/knative-v1.14.1.yaml" \
50+
"$E2E_PATH/resources/knative-v1.17.0.yaml" \
5151
| sed "s/address: \"net-kourier-controller.knative-serving\"/address: \"net-kourier-controller.$(knative_namespace)\"/" \
5252
| yq "
5353
select(.kind != \"Namespace\")

stackgres-k8s/e2e/utils/operator

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,12 @@ before_operator_install_or_upgrade() {
844844
after_operator_install_or_upgrade() {
845845
kubectl label namespace "$OPERATOR_NAMESPACE" --overwrite monitoring=true
846846
wait_services_available "$OPERATOR_NAMESPACE" 1 '^stackgres-operator$'
847+
wait_until eval 'kubectl get validatingwebhookconfigurations.admissionregistration.k8s.io stackgres-operator -o json \
848+
| jq ".webhooks|any(.clientConfig.caBundle == null)" \
849+
| grep -qxF false'
850+
wait_until eval 'kubectl get mutatingwebhookconfigurations.admissionregistration.k8s.io stackgres-operator -o json \
851+
| jq ".webhooks|any(.clientConfig.caBundle == null)" \
852+
| grep -qxF false'
847853
wait_services_available "$OPERATOR_NAMESPACE" 1 '^stackgres-restapi$'
848854
wait_until eval 'kubectl get job -n "$OPERATOR_NAMESPACE" -l "app=StackGresConfig" -o name | wc -l | grep -qxF 0'
849855
if [ "$OPERATOR_FROM" != true ] && [ "$EXTENSIONS_CACHE_ENABLED" = true ]

stackgres-k8s/install/helm/stackgres-operator/templates/mutating-webhook-configuration.yaml

Lines changed: 6 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
{{- $cert := "Cg==" }}
2-
{{- $certSecret := lookup "v1" "Secret" .Release.Namespace (include "cert-name" .) }}
3-
{{- if $certSecret }}
4-
{{- if (index $certSecret.data "tls.crt") }}
5-
{{- $cert = (index $certSecret.data "tls.crt") }}
6-
{{- end }}
7-
{{- end }}
81
apiVersion: admissionregistration.k8s.io/v1
92
kind: MutatingWebhookConfiguration
103
metadata:
@@ -32,7 +25,6 @@ webhooks:
3225
namespace: {{ .Release.Namespace }}
3326
name: {{ .Release.Name }}
3427
path: '/stackgres/mutation/sgcluster'
35-
caBundle: {{ $cert }}
3628
admissionReviewVersions: ["v1"]
3729
{{- if .Values.allowedNamespaces }}
3830
namespaceSelector:
@@ -56,7 +48,6 @@ webhooks:
5648
namespace: {{ .Release.Namespace }}
5749
name: {{ .Release.Name }}
5850
path: '/stackgres/mutation/sgpgconfig'
59-
caBundle: {{ $cert }}
6051
admissionReviewVersions: ["v1"]
6152
{{- if .Values.allowedNamespaces }}
6253
namespaceSelector:
@@ -80,7 +71,6 @@ webhooks:
8071
namespace: {{ .Release.Namespace }}
8172
name: {{ .Release.Name }}
8273
path: '/stackgres/mutation/sgpoolconfig'
83-
caBundle: {{ $cert }}
8474
admissionReviewVersions: ["v1"]
8575
{{- if .Values.allowedNamespaces }}
8676
namespaceSelector:
@@ -104,31 +94,6 @@ webhooks:
10494
namespace: {{ .Release.Namespace }}
10595
name: {{ .Release.Name }}
10696
path: '/stackgres/mutation/sginstanceprofile'
107-
caBundle: {{ $cert }}
108-
admissionReviewVersions: ["v1"]
109-
{{- if .Values.allowedNamespaces }}
110-
namespaceSelector:
111-
matchLabels:
112-
stackgres.io/scope: {{ .Release.Namespace }}.{{ .Release.Name }}
113-
{{- else if .Values.allowedNamespaceLabelSelector }}
114-
namespaceSelector:
115-
matchLabels:
116-
{{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
117-
{{- end }}
118-
- name: sgbackupconfig.mutating-webhook.stackgres.io
119-
sideEffects: None
120-
rules:
121-
- operations: ["CREATE", "UPDATE"]
122-
apiGroups: ["stackgres.io"]
123-
apiVersions: ["*"]
124-
resources: ["sgbackupconfigs"]
125-
failurePolicy: Fail
126-
clientConfig:
127-
service:
128-
namespace: {{ .Release.Namespace }}
129-
name: {{ .Release.Name }}
130-
path: '/stackgres/mutation/sgbackupconfig'
131-
caBundle: {{ $cert }}
13297
admissionReviewVersions: ["v1"]
13398
{{- if .Values.allowedNamespaces }}
13499
namespaceSelector:
@@ -152,7 +117,6 @@ webhooks:
152117
namespace: {{ .Release.Namespace }}
153118
name: {{ .Release.Name }}
154119
path: '/stackgres/mutation/sgbackup'
155-
caBundle: {{ $cert }}
156120
admissionReviewVersions: ["v1"]
157121
{{- if .Values.allowedNamespaces }}
158122
namespaceSelector:
@@ -176,7 +140,6 @@ webhooks:
176140
namespace: {{ .Release.Namespace }}
177141
name: {{ .Release.Name }}
178142
path: '/stackgres/mutation/sgdistributedlogs'
179-
caBundle: {{ $cert }}
180143
admissionReviewVersions: ["v1"]
181144
{{- if .Values.allowedNamespaces }}
182145
namespaceSelector:
@@ -200,7 +163,6 @@ webhooks:
200163
namespace: {{ .Release.Namespace }}
201164
name: {{ .Release.Name }}
202165
path: '/stackgres/mutation/sgdbops'
203-
caBundle: {{ $cert }}
204166
admissionReviewVersions: ["v1"]
205167
{{- if .Values.allowedNamespaces }}
206168
namespaceSelector:
@@ -224,7 +186,6 @@ webhooks:
224186
namespace: {{ .Release.Namespace }}
225187
name: {{ .Release.Name }}
226188
path: '/stackgres/mutation/sgobjectstorage'
227-
caBundle: {{ $cert }}
228189
admissionReviewVersions: ["v1"]
229190
{{- if .Values.allowedNamespaces }}
230191
namespaceSelector:
@@ -235,7 +196,7 @@ webhooks:
235196
matchLabels:
236197
{{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
237198
{{- end }}
238-
- name: sgscripts.mutating-webhook.stackgres.io
199+
- name: sgscript.mutating-webhook.stackgres.io
239200
sideEffects: None
240201
rules:
241202
- operations: ["CREATE", "UPDATE"]
@@ -248,7 +209,6 @@ webhooks:
248209
namespace: {{ .Release.Namespace }}
249210
name: {{ .Release.Name }}
250211
path: '/stackgres/mutation/sgscript'
251-
caBundle: {{ $cert }}
252212
admissionReviewVersions: ["v1"]
253213
{{- if .Values.allowedNamespaces }}
254214
namespaceSelector:
@@ -259,7 +219,7 @@ webhooks:
259219
matchLabels:
260220
{{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
261221
{{- end }}
262-
- name: sgshardedclusters.mutating-webhook.stackgres.io
222+
- name: sgshardedcluster.mutating-webhook.stackgres.io
263223
sideEffects: None
264224
rules:
265225
- operations: ["CREATE", "UPDATE"]
@@ -272,7 +232,6 @@ webhooks:
272232
namespace: {{ .Release.Namespace }}
273233
name: {{ .Release.Name }}
274234
path: '/stackgres/mutation/sgshardedcluster'
275-
caBundle: {{ $cert }}
276235
admissionReviewVersions: ["v1"]
277236
{{- if .Values.allowedNamespaces }}
278237
namespaceSelector:
@@ -283,7 +242,7 @@ webhooks:
283242
matchLabels:
284243
{{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
285244
{{- end }}
286-
- name: sgshardedbackups.mutating-webhook.stackgres.io
245+
- name: sgshardedbackup.mutating-webhook.stackgres.io
287246
sideEffects: None
288247
rules:
289248
- operations: ["CREATE", "UPDATE"]
@@ -296,7 +255,6 @@ webhooks:
296255
namespace: {{ .Release.Namespace }}
297256
name: {{ .Release.Name }}
298257
path: '/stackgres/mutation/sgshardedbackup'
299-
caBundle: {{ $cert }}
300258
admissionReviewVersions: ["v1"]
301259
{{- if .Values.allowedNamespaces }}
302260
namespaceSelector:
@@ -320,7 +278,6 @@ webhooks:
320278
namespace: {{ .Release.Namespace }}
321279
name: {{ .Release.Name }}
322280
path: '/stackgres/mutation/sgshardeddbops'
323-
caBundle: {{ $cert }}
324281
admissionReviewVersions: ["v1"]
325282
{{- if .Values.allowedNamespaces }}
326283
namespaceSelector:
@@ -331,7 +288,7 @@ webhooks:
331288
matchLabels:
332289
{{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
333290
{{- end }}
334-
- name: sgstreams.mutating-webhook.stackgres.io
291+
- name: sgstream.mutating-webhook.stackgres.io
335292
sideEffects: None
336293
rules:
337294
- operations: ["CREATE", "UPDATE"]
@@ -343,8 +300,7 @@ webhooks:
343300
service:
344301
namespace: {{ .Release.Namespace }}
345302
name: {{ .Release.Name }}
346-
path: '/stackgres/mutation/sgstreams'
347-
caBundle: {{ $cert }}
303+
path: '/stackgres/mutation/sgstream'
348304
admissionReviewVersions: ["v1"]
349305
{{- if .Values.allowedNamespaces }}
350306
namespaceSelector:
@@ -355,4 +311,4 @@ webhooks:
355311
matchLabels:
356312
{{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
357313
{{- end }}
358-
314+

0 commit comments

Comments
 (0)