Skip to content

Commit eec1713

Browse files
committed
fix: avoid sctrict validation while creating SGConfig with helm
1 parent fb3e2e9 commit eec1713

3 files changed

Lines changed: 11 additions & 28 deletions

File tree

stackgres-k8s/install/helm/stackgres-operator/templates/sgconfig.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ data:
3434
name: {{ .Release.Name }}
3535
namespace: {{ .Values.sgConfigNamespace | default .Release.Namespace }}
3636
spec:
37-
{{ regexReplaceAll "[^ ]+: null" (unset .Values "global" | toYaml | nindent 6) "" }}
37+
{{- $spec := dict }}
38+
{{- range .Values.specFields }}
39+
{{- $spec := set $spec . (index $.Values .) }}
40+
{{- end }}
41+
{{ regexReplaceAll "[^ ]+: null" (toYaml $spec | nindent 6) "" }}
3842
---
3943
apiVersion: batch/v1
4044
kind: Job

stackgres-k8s/install/helm/stackgres-operator/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,3 +551,9 @@ developer:
551551
volumes: []
552552
# -- Pod's container volume mounts. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#volumemount-v1-core
553553
volumeMounts: []
554+
# -- The list of fields that are serialized into the spec of SGConfig
555+
specFields: [
556+
containerRegistry, imagePullPolicy, imagePullSecrets, allowedNamespaces, allowedNamespaceLabelSelector,
557+
disableClusterRole, allowImpersonationForRestApi, disableCrdsAndWebhooksUpdate, sgConfigNamespace,
558+
serviceAccount, operator, restapi, adminui, collector, jobs, deploy, cert, rbac, authentication,
559+
prometheus, grafana, extensions, shardingSphere, developer ]

stackgres-k8s/src/common/src/main/resources/crds/SGConfig.yaml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,27 +1082,6 @@ spec:
10821082
description: |
10831083
If set, will use a host path volume with the specified path for the extensions cache
10841084
instead of a PersistentVolume
1085-
pga:
1086-
type: object
1087-
description: Section to configure PGA
1088-
properties:
1089-
repositoryUrls:
1090-
type: array
1091-
default:
1092-
- https://pga.sh
1093-
description: |
1094-
A list of PGA repository URLs used to retrieve images
1095-
1096-
To set a proxy for PGA repository add parameter proxyUrl to the URL:
1097-
`https://extensions.stackgres.io/postgres/repository?proxyUrl=<proxy scheme>%3A%2F%2F<proxy host>[%3A<proxy port>]` (URL encoded)
1098-
1099-
Other URL parameters are:
1100-
1101-
* `skipHostnameVerification`: set it to `true` in order to use a server or a proxy with a self signed certificate
1102-
* `retry`: set it to `<max retriex>[:<sleep before next retry>]` in order to retry a request on failure
1103-
* `setHttpScheme`: set it to `true` in order to force using HTTP scheme
1104-
items:
1105-
type: string
11061085
shardingSphere:
11071086
type: object
11081087
description: Section to configure integration with ShardingSphere operator
@@ -1173,12 +1152,6 @@ spec:
11731152
externalRestApiPort:
11741153
type: integer
11751154
description: Set the external REST API port
1176-
externalPgaIp:
1177-
type: string
1178-
description: Set the external PGA IP
1179-
externalPgaPort:
1180-
type: integer
1181-
description: Set the external PGA port
11821155
allowPullExtensionsFromImageRepository:
11831156
type: boolean
11841157
default: false

0 commit comments

Comments
 (0)