/
postgres_version_types.go
71 lines (60 loc) · 2.23 KB
/
postgres_version_types.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package v1alpha1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
const (
ResourceCodePostgresVersion = "pgversion"
ResourceKindPostgresVersion = "PostgresVersion"
ResourceSingularPostgresVersion = "postgresversion"
ResourcePluralPostgresVersion = "postgresversions"
)
// +genclient
// +genclient:nonNamespaced
// +genclient:skipVerbs=updateStatus
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PostgresVersion defines a Postgres database version.
type PostgresVersion struct {
metav1.TypeMeta `json:",inline,omitempty"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec PostgresVersionSpec `json:"spec,omitempty"`
}
// PostgresVersionSpec is the spec for postgres version
type PostgresVersionSpec struct {
// Version
Version string `json:"version"`
// Database Image
DB PostgresVersionDatabase `json:"db"`
// Exporter Image
Exporter PostgresVersionExporter `json:"exporter"`
// Tools Image
Tools PostgresVersionTools `json:"tools"`
// Deprecated versions usable but regarded as obsolete and best avoided, typically due to having been superseded.
// +optional
Deprecated bool `json:"deprecated,omitempty"`
// PSP names
PodSecurityPolicies PostgresVersionPodSecurityPolicy `json:"podSecurityPolicies"`
}
// PostgresVersionDatabase is the Postgres Database image
type PostgresVersionDatabase struct {
Image string `json:"image"`
}
// PostgresVersionExporter is the image for the Postgres exporter
type PostgresVersionExporter struct {
Image string `json:"image"`
}
// PostgresVersionTools is the image for the postgres tools
type PostgresVersionTools struct {
Image string `json:"image"`
}
// PostgresVersionPodSecurityPolicy is the Postgres pod security policies
type PostgresVersionPodSecurityPolicy struct {
DatabasePolicyName string `json:"databasePolicyName"`
SnapshotterPolicyName string `json:"snapshotterPolicyName"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PostgresVersionList is a list of PostgresVersions
type PostgresVersionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
// Items is a list of PostgresVersion CRD objects
Items []PostgresVersion `json:"items,omitempty"`
}