Skip to content

Commit c388cb8

Browse files
merge: pull in changes from main branch & resolve merge conflicts
2 parents 9439983 + cc869c8 commit c388cb8

File tree

98 files changed

+11638
-4369
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+11638
-4369
lines changed

.golangci.yaml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,28 @@ linters:
2525
preference: WhenRequired
2626
policy: SuggestFix
2727
omitEmpty:
28-
# Ignore missing omitempty so that we can omit the omitempty for discoverability.
29-
# Discoverability is for configuration APIs, generally singletons.
30-
# Refer to the API conventions for when to use discoverability (not our default stance).
31-
policy: Ignore
28+
# This will force omitempty on optional fields.
29+
# This is in line with upstream guidance where optional fields should be omitted
30+
# from the serialized output unless they are non-zero.
31+
policy: SuggestFix
32+
omitzero:
33+
# This will force omitzero on optional struct fields.
34+
# This means they can be omitted correctly and prevents the need for pointers to structs.
35+
policy: SuggestFix
36+
requiredFields:
37+
pointers:
38+
# This will force pointers when the field is required, but only when the zero
39+
# value is a valid user choice, and has a semantic difference to being omitted (e.g. replicas allows 0).
40+
policy: SuggestFix
41+
omitempty:
42+
# This will force omitempty on required fields.
43+
# We do this so that the behaviour of not setting a value for the field is the same between
44+
# both structured and unstructured clients.
45+
policy: SuggestFix
46+
omitzero:
47+
# This will force omitzero on required struct fields.
48+
# This means they can be omitted correctly and prevents the need for pointers to structs.
49+
policy: SuggestFix
3250
uniqueMarkers:
3351
customMarkers:
3452
- identifier: "openshift:validation:FeatureGateAwareEnum"

0 commit comments

Comments
 (0)