Skip to content

Commit 3e1514c

Browse files
committed
fix: wrong original SGStream service path in webhooks, avoid setting caBundle in webhooks, follow webhooks original ordering, avoid usage of nullable in CRDs
1 parent e368bbc commit 3e1514c

3 files changed

Lines changed: 6 additions & 46 deletions

File tree

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: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -104,29 +104,6 @@ webhooks:
104104
matchLabels:
105105
{{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
106106
{{- end }}
107-
- name: sgbackupconfig.mutating-webhook.stackgres.io
108-
sideEffects: None
109-
rules:
110-
- operations: ["CREATE", "UPDATE"]
111-
apiGroups: ["stackgres.io"]
112-
apiVersions: ["*"]
113-
resources: ["sgbackupconfigs"]
114-
failurePolicy: Fail
115-
clientConfig:
116-
service:
117-
namespace: {{ .Release.Namespace }}
118-
name: {{ .Release.Name }}
119-
path: '/stackgres/mutation/sgbackupconfig'
120-
admissionReviewVersions: ["v1"]
121-
{{- if .Values.allowedNamespaces }}
122-
namespaceSelector:
123-
matchLabels:
124-
stackgres.io/scope: {{ .Release.Namespace }}.{{ .Release.Name }}
125-
{{- else if .Values.allowedNamespaceLabelSelector }}
126-
namespaceSelector:
127-
matchLabels:
128-
{{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
129-
{{- end }}
130107
- name: sgbackup.mutating-webhook.stackgres.io
131108
sideEffects: None
132109
rules:

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

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -104,29 +104,6 @@ webhooks:
104104
matchLabels:
105105
{{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
106106
{{- end }}
107-
- name: sgbackupconfig.validating-webhook.stackgres.io
108-
sideEffects: None
109-
rules:
110-
- operations: ["CREATE", "UPDATE", "DELETE"]
111-
apiGroups: ["stackgres.io"]
112-
apiVersions: ["*"]
113-
resources: ["sgbackupconfigs"]
114-
failurePolicy: Fail
115-
clientConfig:
116-
service:
117-
namespace: {{ .Release.Namespace }}
118-
name: {{ .Release.Name }}
119-
path: '/stackgres/validation/sgbackupconfig'
120-
admissionReviewVersions: ["v1"]
121-
{{- if .Values.allowedNamespaces }}
122-
namespaceSelector:
123-
matchLabels:
124-
stackgres.io/scope: {{ .Release.Namespace }}.{{ .Release.Name }}
125-
{{- else if .Values.allowedNamespaceLabelSelector }}
126-
namespaceSelector:
127-
matchLabels:
128-
{{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
129-
{{- end }}
130107
- name: sgbackup.validating-webhook.stackgres.io
131108
sideEffects: None
132109
rules:

0 commit comments

Comments
 (0)