Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion operator/v1/types_ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -1912,7 +1912,7 @@ type IngressControllerTuningOptions struct {
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=16
// +optional
HTTPKeepAliveTimeout metav1.Duration `json:"httpKeepAliveTimeout,omitempty"`
HTTPKeepAliveTimeout *metav1.Duration `json:"httpKeepAliveTimeout,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We try to avoid pointers where possible.

If the zero value is not a valid value, there isn't really any need for a pointer. It looks like metav1.Duration is a struct and not a type alias.

Does adding omitzero resolve this issue?

Suggested change
HTTPKeepAliveTimeout *metav1.Duration `json:"httpKeepAliveTimeout,omitempty"`
HTTPKeepAliveTimeout metav1.Duration `json:"httpKeepAliveTimeout,omitempty,omitzero"`

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alebedev87 reminded me that this needs to be backported to 4.16 which will not support the omitzero tag.

Pointer is correct here.


// tlsInspectDelay defines how long the router can hold data to find a
// matching route.
Expand Down
6 changes: 5 additions & 1 deletion operator/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.