From 2f0facd2f50eb9545d8525e17adb55ac820c9b61 Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Thu, 31 Oct 2019 16:36:46 +0100 Subject: [PATCH] add supoort for initContainers and sidecars --- .../templates/customrresourcedefinition.yaml | 18 ++++++++++ manifests/postgresql.crd.yaml | 19 ++++++++++- pkg/apis/acid.zalan.do/v1/crds.go | 34 +++++++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/charts/postgres-operator/templates/customrresourcedefinition.yaml b/charts/postgres-operator/templates/customrresourcedefinition.yaml index 02bedcc2c..0fbafe3de 100644 --- a/charts/postgres-operator/templates/customrresourcedefinition.yaml +++ b/charts/postgres-operator/templates/customrresourcedefinition.yaml @@ -124,6 +124,18 @@ spec: type: boolean enableShmVolume: type: boolean + init_containers: # deprecated + type: array + nullable: true + items: + type: object + additionalProperties: true + initContainers: + type: array + nullable: true + items: + type: object + additionalProperties: true logicalBackupSchedule: type: string pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$' @@ -253,6 +265,12 @@ spec: pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$' # Note: the value specified here must not be zero or be higher # than the corresponding limit. + sidecars: + type: array + nullable: true + items: + type: object + additionalProperties: true spiloFSGroup: type: integer standby: diff --git a/manifests/postgresql.crd.yaml b/manifests/postgresql.crd.yaml index faf1f8c10..107391676 100644 --- a/manifests/postgresql.crd.yaml +++ b/manifests/postgresql.crd.yaml @@ -36,7 +36,6 @@ spec: - numberOfInstances - teamId - postgresql - additionalProperties: true properties: allowedSourceRanges: type: array @@ -85,6 +84,18 @@ spec: type: boolean enableShmVolume: type: boolean + init_containers: # deprecated + type: array + nullable: true + items: + type: object + additionalProperties: true + initContainers: + type: array + nullable: true + items: + type: object + additionalProperties: true logicalBackupSchedule: type: string pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$' @@ -214,6 +225,12 @@ spec: pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$' # Note: the value specified here must not be zero or be higher # than the corresponding limit. + sidecars: + type: array + nullable: true + items: + type: object + additionalProperties: true spiloFSGroup: type: integer standby: diff --git a/pkg/apis/acid.zalan.do/v1/crds.go b/pkg/apis/acid.zalan.do/v1/crds.go index d03100711..d26fac723 100644 --- a/pkg/apis/acid.zalan.do/v1/crds.go +++ b/pkg/apis/acid.zalan.do/v1/crds.go @@ -199,6 +199,29 @@ var PostgresCRDResourceValidation = apiextv1beta1.JSONSchemaProps{ "enableShmVolume": { Type: "boolean", }, + "init_containers": { + Type: "array", + Description: "Deprecated", + Items: &apiextv1beta1.JSONSchemaPropsOrArray{ + Schema: &apiextv1beta1.JSONSchemaProps{ + Type: "object", + AdditionalProperties: &apiextv1beta1.JSONSchemaPropsOrBool{ + Allows: true, + }, + }, + }, + }, + "initContainers": { + Type: "array", + Items: &apiextv1beta1.JSONSchemaPropsOrArray{ + Schema: &apiextv1beta1.JSONSchemaProps{ + Type: "object", + AdditionalProperties: &apiextv1beta1.JSONSchemaPropsOrBool{ + Allows: true, + }, + }, + }, + }, "logicalBackupSchedule": { Type: "string", Pattern: "^(\\d+|\\*)(/\\d+)?(\\s+(\\d+|\\*)(/\\d+)?){4}$", @@ -351,6 +374,17 @@ var PostgresCRDResourceValidation = apiextv1beta1.JSONSchemaProps{ }, }, }, + "sidecars": { + Type: "array", + Items: &apiextv1beta1.JSONSchemaPropsOrArray{ + Schema: &apiextv1beta1.JSONSchemaProps{ + Type: "object", + AdditionalProperties: &apiextv1beta1.JSONSchemaPropsOrBool{ + Allows: true, + }, + }, + }, + }, "spiloFSGroup": { Type: "integer", },