/
sgpostresconfig.go
49 lines (37 loc) · 2.13 KB
/
sgpostresconfig.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// This CRD isn't autogenerated, as the generator from the CRD somewhat falls apart with this one.
// As it only has two fields it should not be too much trouble.
// +kubebuilder:object:root=true
type SGPostgresConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Spec defines the desired state of a SGPostgresConfig.
Spec SGPostgresConfigSpec `json:"spec"`
// Status reflects the observed state of a SGPostgresConfig.
Status SGPostgresConfigStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
type SGPostgesConfigList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []SGPostgresConfig `json:"items"`
}
// SGPostgresConfigSpec defines model for SGPostgresConfigSpec.
type SGPostgresConfigSpec struct {
// The **major** Postgres version the configuration is for. Postgres major versions contain one number starting with version 10 (`10`, `11`, `12`, etc), and two numbers separated by a dot for previous versions (`9.6`, `9.5`, etc).
//
// Note that Postgres maintains full compatibility across minor versions, and hence a configuration for a given major version will work for any minor version of that same major version.
//
// Check [StackGres component versions](https://stackgres.io/doc/latest/intro/versions) to see the Postgres versions supported by this version of StackGres.
PostgresVersion string `json:"postgresVersion"`
// The `postgresql.conf` parameters the configuration contains, represented as an object where the keys are valid names for the `postgresql.conf` configuration file parameters of the given `postgresVersion`. You may check [postgresqlco.nf](https://postgresqlco.nf) as a reference on how to tune and find the valid parameters for a given major version.
PostgresqlConf map[string]string `json:"postgresql.conf"`
}
// SGPostgresConfigStatus defines model for SGPostgresConfigStatus.
type SGPostgresConfigStatus struct {
// The `postgresql.conf` default parameters which are used if not set.
PostgresqlConf map[string]string `json:"postgresql.conf"`
}