You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .golangci-kal.yml
+37-5Lines changed: 37 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -11,18 +11,50 @@ linters:
11
11
settings:
12
12
linters:
13
13
enable:
14
-
- "duplicatemarkers"# Ensure there are no exact duplicate markers. for types and fields.
15
-
- "jsontags"# Ensure every field has a json tag.
16
-
- "nofloats"# Ensure floats are not used.
17
-
- "nomaps"# Ensure maps are not used.
14
+
- "defaultorrequired"# defaultorrequired analyzer checks that fields marked as required do not have default values applied.
15
+
- "defaults"# defaults is a linter to check that fields with default markers are configured correctly.
16
+
- "duplicatemarkers"# Ensures there are no exact duplicate markers. for types and fields.
17
+
- "jsontags"# Ensures every field has a json tag.
18
+
- "nodurations"# Ensures that fields in the API types do not contain `Duration` type ether from the `time` package or the `k8s.io/apimachinery/pkg/apis/meta/v1` package
19
+
- "nofloats"# Ensures floats are not used.
20
+
- "nomaps"# Ensures maps are not used.
21
+
- "nonullable"# Ensures that types and fields do not have the `nullable` marker
18
22
- "nophase"# Phase fields are discouraged by the Kube API conventions, use conditions instead.
23
+
- "noreferences"# Ensures that field names use 'Ref'/'Refs' instead of 'Reference'/'References'.
24
+
- "notimestamp"# Ensures that structs do not contain a TimeStamp field.
19
25
- "optionalorrequired"# Every field should be marked as `+optional` or `+required`.
Copy file name to clipboardExpand all lines: apis/v1/backendtlspolicy_types.go
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ type BackendTLSPolicy struct {
37
37
38
38
// Spec defines the desired state of BackendTLSPolicy.
39
39
// +required
40
-
SpecBackendTLSPolicySpec`json:"spec"`
40
+
SpecBackendTLSPolicySpec`json:"spec,omitzero"`
41
41
42
42
// Status defines the current state of BackendTLSPolicy.
43
43
// +optional
@@ -120,7 +120,7 @@ type BackendTLSPolicySpec struct {
120
120
// +kubebuilder:validation:MaxItems=16
121
121
// +kubebuilder:validation:XValidation:message="sectionName must be specified when targetRefs includes 2 or more references to the same target",rule="self.all(p1, self.all(p2, p1.group == p2.group && p1.kind == p2.kind && p1.name == p2.name ? ((!has(p1.sectionName) || p1.sectionName == '') == (!has(p2.sectionName) || p2.sectionName == '')) : true))"
122
122
// +kubebuilder:validation:XValidation:message="sectionName must be unique when targetRefs includes 2 or more references to the same target",rule="self.all(p1, self.exists_one(p2, p1.group == p2.group && p1.kind == p2.kind && p1.name == p2.name && (((!has(p1.sectionName) || p1.sectionName == '') && (!has(p2.sectionName) || p2.sectionName == '')) || (has(p1.sectionName) && has(p2.sectionName) && p1.sectionName == p2.sectionName))))"
Copy file name to clipboardExpand all lines: apis/v1alpha2/tcproute_types.go
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ type TCPRouteSpec struct {
55
55
// +kubebuilder:validation:MinItems=1
56
56
// +kubebuilder:validation:MaxItems=16
57
57
// <gateway:experimental:validation:XValidation:message="Rule name must be unique within the route",rule="self.all(l1, !has(l1.name) || self.exists_one(l2, has(l2.name) && l1.name == l2.name))">
58
-
Rules []TCPRouteRule`json:"rules"`
58
+
Rules []TCPRouteRule`json:"rules,omitempty"`
59
59
}
60
60
61
61
// TCPRouteStatus defines the observed state of TCPRoute
// Listeners associated with this ListenerSet. Listeners define
83
83
// logical endpoints that are bound on this referenced parent Gateway's addresses.
@@ -117,7 +117,7 @@ type ListenerSetSpec struct {
117
117
// +kubebuilder:validation:XValidation:message="Listener name must be unique within the Gateway",rule="self.all(l1, self.exists_one(l2, l1.name == l2.name))"
118
118
// +kubebuilder:validation:XValidation:message="Combination of port, protocol and hostname must be unique for each listener",rule="self.all(l1, !has(l1.port) || self.exists_one(l2, has(l2.port) && l1.port == l2.port && l1.protocol == l2.protocol && (has(l1.hostname) && has(l2.hostname) ? l1.hostname == l2.hostname : !has(l1.hostname) && !has(l2.hostname))))"
0 commit comments