Skip to content

Commit 44f08bc

Browse files
authored
fix: add missing json tags to the MaintenanceWindow type struct. (zalando#2148)
If you import the zalando postgresql v1 api with kubebuilder, it complains about the missing tags. ``` ❯ make manifests test -s /.../bin/controller-gen && /.../bin/controller-gen --version | grep -q v0.10.0 || \ GOBIN=/.../bin go install sigs.k8s.io/controller-tools/cmd/[email protected] /.../bin/controller-gen rbac:roleName=manager-role crd:allowDangerousTypes=true webhook paths="./..." output:crd:artifacts:config=config/crd/bases /.../go/pkg/mod/github.com/zalando/[email protected]/pkg/apis/acid.zalan.do/v1/postgresql_type.go:116:2: encountered struct field "Everyday" without JSON tag in type "MaintenanceWindow" /.../go/pkg/mod/github.com/zalando/[email protected]/pkg/apis/acid.zalan.do/v1/postgresql_type.go:117:2: encountered struct field "Weekday" without JSON tag in type "MaintenanceWindow" /.../go/pkg/mod/github.com/zalando/[email protected]/pkg/apis/acid.zalan.do/v1/postgresql_type.go:118:2: encountered struct field "StartTime" without JSON tag in type "MaintenanceWindow" /.../go/pkg/mod/github.com/zalando/[email protected]/pkg/apis/acid.zalan.do/v1/postgresql_type.go:119:2: encountered struct field "EndTime" without JSON tag in type "MaintenanceWindow" Error: not all generators ran successfully run `controller-gen rbac:roleName=manager-role crd:allowDangerousTypes=true webhook paths=./... output:crd:artifacts:config=config/crd/bases -w` to see all available markers, or `controller-gen rbac:roleName=manager-role crd:allowDangerousTypes=true webhook paths=./... output:crd:artifacts:config=config/crd/bases -h` for usage make: *** [manifests] Error 1 ```
1 parent 4534a4c commit 44f08bc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ type PreparedSchema struct {
115115

116116
// MaintenanceWindow describes the time window when the operator is allowed to do maintenance on a cluster.
117117
type MaintenanceWindow struct {
118-
Everyday bool
119-
Weekday time.Weekday
120-
StartTime metav1.Time // Start time
121-
EndTime metav1.Time // End time
118+
Everyday bool `json:"everyday,omitempty"`
119+
Weekday time.Weekday `json:"weekday,omitempty"`
120+
StartTime metav1.Time `json:"startTime,omitempty"`
121+
EndTime metav1.Time `json:"endTime,omitempty"`
122122
}
123123

124124
// Volume describes a single volume in the manifest.

0 commit comments

Comments
 (0)