Skip to content

Commit 598c05b

Browse files
add to postgresql_type.go omitempty annotation (zalando#1223)
* add to postgresql_type.go omitempty annotation * add postgresql_type.go additional omitempty * remove postgresql.go defaults
1 parent 5a6da72 commit 598c05b

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

pkg/apis/acid.zalan.do/v1/postgresql_type.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ type PostgresSpec struct {
5454
AllowedSourceRanges []string `json:"allowedSourceRanges"`
5555

5656
NumberOfInstances int32 `json:"numberOfInstances"`
57-
Users map[string]UserFlags `json:"users"`
57+
Users map[string]UserFlags `json:"users,omitempty"`
5858
MaintenanceWindows []MaintenanceWindow `json:"maintenanceWindows,omitempty"`
5959
Clone *CloneDescription `json:"clone,omitempty"`
6060
ClusterName string `json:"-"`
@@ -113,22 +113,22 @@ type MaintenanceWindow struct {
113113
// Volume describes a single volume in the manifest.
114114
type Volume struct {
115115
Size string `json:"size"`
116-
StorageClass string `json:"storageClass"`
116+
StorageClass string `json:"storageClass,omitempty"`
117117
SubPath string `json:"subPath,omitempty"`
118118
}
119119

120120
type AdditionalVolume struct {
121121
Name string `json:"name"`
122122
MountPath string `json:"mountPath"`
123-
SubPath string `json:"subPath"`
123+
SubPath string `json:"subPath,omitempty"`
124124
TargetContainers []string `json:"targetContainers"`
125125
VolumeSource v1.VolumeSource `json:"volumeSource"`
126126
}
127127

128128
// PostgresqlParam describes PostgreSQL version and pairs of configuration parameter name - values.
129129
type PostgresqlParam struct {
130130
PgVersion string `json:"version"`
131-
Parameters map[string]string `json:"parameters"`
131+
Parameters map[string]string `json:"parameters,omitempty"`
132132
}
133133

134134
// ResourceDescription describes CPU and memory resources defined for a cluster.
@@ -145,15 +145,15 @@ type Resources struct {
145145

146146
// Patroni contains Patroni-specific configuration
147147
type Patroni struct {
148-
InitDB map[string]string `json:"initdb"`
149-
PgHba []string `json:"pg_hba"`
150-
TTL uint32 `json:"ttl"`
151-
LoopWait uint32 `json:"loop_wait"`
152-
RetryTimeout uint32 `json:"retry_timeout"`
153-
MaximumLagOnFailover float32 `json:"maximum_lag_on_failover"` // float32 because https://github.com/kubernetes/kubernetes/issues/30213
154-
Slots map[string]map[string]string `json:"slots"`
155-
SynchronousMode bool `json:"synchronous_mode"`
156-
SynchronousModeStrict bool `json:"synchronous_mode_strict"`
148+
InitDB map[string]string `json:"initdb,omitempty"`
149+
PgHba []string `json:"pg_hba,omitempty"`
150+
TTL uint32 `json:"ttl,omitempty"`
151+
LoopWait uint32 `json:"loop_wait,omitempty"`
152+
RetryTimeout uint32 `json:"retry_timeout,omitempty"`
153+
MaximumLagOnFailover float32 `json:"maximum_lag_on_failover,omitempty"` // float32 because https://github.com/kubernetes/kubernetes/issues/30213
154+
Slots map[string]map[string]string `json:"slots,omitempty"`
155+
SynchronousMode bool `json:"synchronous_mode,omitempty"`
156+
SynchronousModeStrict bool `json:"synchronous_mode_strict,omitempty"`
157157
}
158158

159159
//StandbyCluster

0 commit comments

Comments
 (0)