diff --git a/charts/templates/nais.io_applications.yaml b/charts/templates/nais.io_applications.yaml index 58cbf5b..2b294ce 100644 --- a/charts/templates/nais.io_applications.yaml +++ b/charts/templates/nais.io_applications.yaml @@ -555,8 +555,9 @@ spec: type: object type: array sqlInstances: - description: Provision database instances and connect them to - your application. + description: |- + Provision database instances and connect them to your application. + Only one item allowed in the list. items: properties: autoBackupHour: @@ -576,8 +577,9 @@ spec: description: Sort order for `ORDER BY ...` clauses. type: string databases: - description: List of databases that should be created on - this Postgres server. + description: |- + List of one database or less(!) that should be created on this Postgres server. + If not present, a default database with the same name as the application will be created. items: properties: envVarPrefix: diff --git a/charts/templates/nais.io_naisjobs.yaml b/charts/templates/nais.io_naisjobs.yaml index 77a1bbf..86f264a 100644 --- a/charts/templates/nais.io_naisjobs.yaml +++ b/charts/templates/nais.io_naisjobs.yaml @@ -516,8 +516,9 @@ spec: type: object type: array sqlInstances: - description: Provision database instances and connect them to - your application. + description: |- + Provision database instances and connect them to your application. + Only one item allowed in the list. items: properties: autoBackupHour: @@ -537,8 +538,9 @@ spec: description: Sort order for `ORDER BY ...` clauses. type: string databases: - description: List of databases that should be created on - this Postgres server. + description: |- + List of one database or less(!) that should be created on this Postgres server. + If not present, a default database with the same name as the application will be created. items: properties: envVarPrefix: diff --git a/config/crd/bases/nais.io_applications.yaml b/config/crd/bases/nais.io_applications.yaml index 58cbf5b..2b294ce 100644 --- a/config/crd/bases/nais.io_applications.yaml +++ b/config/crd/bases/nais.io_applications.yaml @@ -555,8 +555,9 @@ spec: type: object type: array sqlInstances: - description: Provision database instances and connect them to - your application. + description: |- + Provision database instances and connect them to your application. + Only one item allowed in the list. items: properties: autoBackupHour: @@ -576,8 +577,9 @@ spec: description: Sort order for `ORDER BY ...` clauses. type: string databases: - description: List of databases that should be created on - this Postgres server. + description: |- + List of one database or less(!) that should be created on this Postgres server. + If not present, a default database with the same name as the application will be created. items: properties: envVarPrefix: diff --git a/config/crd/bases/nais.io_naisjobs.yaml b/config/crd/bases/nais.io_naisjobs.yaml index 77a1bbf..86f264a 100644 --- a/config/crd/bases/nais.io_naisjobs.yaml +++ b/config/crd/bases/nais.io_naisjobs.yaml @@ -516,8 +516,9 @@ spec: type: object type: array sqlInstances: - description: Provision database instances and connect them to - your application. + description: |- + Provision database instances and connect them to your application. + Only one item allowed in the list. items: properties: autoBackupHour: @@ -537,8 +538,9 @@ spec: description: Sort order for `ORDER BY ...` clauses. type: string databases: - description: List of databases that should be created on - this Postgres server. + description: |- + List of one database or less(!) that should be created on this Postgres server. + If not present, a default database with the same name as the application will be created. items: properties: envVarPrefix: diff --git a/pkg/apis/nais.io/v1/naiserator_types.go b/pkg/apis/nais.io/v1/naiserator_types.go index 27a6601..a6160a9 100644 --- a/pkg/apis/nais.io/v1/naiserator_types.go +++ b/pkg/apis/nais.io/v1/naiserator_types.go @@ -132,6 +132,7 @@ type GCP struct { // +nais:doc:Availability=GCP Buckets []CloudStorageBucket `json:"buckets,omitempty"` // Provision database instances and connect them to your application. + // Only one item allowed in the list. // +nais:doc:Link="https://doc.nais.io/persistence/postgres/";"https://cloud.google.com/sql/docs/postgres/instance-settings#impact" // +nais:doc:Availability=GCP // +kubebuilder:validation:MaxItems=1 @@ -582,8 +583,8 @@ type CloudSqlInstance struct { TransactionLogRetentionDays *int `json:"transactionLogRetentionDays,omitempty"` // Desired maintenance window for database updates. Maintenance *Maintenance `json:"maintenance,omitempty"` - // List of databases that should be created on this Postgres server. - // +kubebuilder:validation:Required + // List of one database or less(!) that should be created on this Postgres server. + // If not present, a default database with the same name as the application will be created. // +kubebuilder:validation:MaxItems=1 Databases []CloudSqlDatabase `json:"databases,omitempty"` // Remove the entire Postgres server including all data when the Kubernetes resource is deleted.