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
+19-6Lines changed: 19 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,7 @@ linters:
27
27
# having the `omitempty` value in their `json` tag where appropriate.
28
28
- "optionalorrequired"# Every field should be marked as `+optional` or `+required`.
29
29
- "requiredfields"# Required fields should not be pointers, and should not have `omitempty`.
30
+
- "ssatags"# Ensure array fields have the appropriate listType markers
30
31
- "statusoptional"# Ensure all first children within status should be optional.
31
32
- "statussubresource"# All root objects that have a `status` field should have a status subresource.
32
33
- "uniquemarkers"# Ensure that types and fields do not contain more than a single definition of a marker that should only be present once.
@@ -44,19 +45,21 @@ linters:
44
45
isFirstField: Warn # Require conditions to be the first field in the status struct.
45
46
usePatchStrategy: Forbid # Require conditions to be the first field in the status struct.
46
47
useProtobuf: Forbid # We don't use protobuf, so protobuf tags are not required.
47
-
optionalFields:
48
+
optionalfields:
48
49
pointers:
49
50
preference: WhenRequired # Always | WhenRequired # Whether to always require pointers, or only when required. Defaults to `Always`.
50
51
policy: SuggestFix # SuggestFix | Warn # The policy for pointers in optional fields. Defaults to `SuggestFix`.
51
52
omitempty:
52
53
policy: SuggestFix # SuggestFix | Warn | Ignore # The policy for omitempty in optional fields. Defaults to `SuggestFix`.
53
-
#jsonTags:
54
+
#jsontags:
54
55
# jsonTagRegex: "^[a-z][a-z0-9]*(?:[A-Z][a-z0-9]*)*$" # The default regex is appropriate for our use case.
55
-
#optionalOrRequired:
56
+
#optionalorrequired:
56
57
# preferredOptionalMarker: optional | kubebuilder:validation:Optional # The preferred optional marker to use, fixes will suggest to use this marker. Defaults to `optional`.
57
58
# preferredRequiredMarker: required | kubebuilder:validation:Required # The preferred required marker to use, fixes will suggest to use this marker. Defaults to `required`.
58
-
#requiredFields:
59
+
#requiredfields:
59
60
# pointerPolicy: Warn | SuggestFix # Defaults to `SuggestFix`. We want our required fields to not be pointers.
61
+
# ssatags:
62
+
# listTypeSetUsage: Warn | Ignore # The policy for listType=set usage on object arrays. Defaults to `Warn`.
60
63
61
64
exclusions:
62
65
generated: strict
@@ -83,23 +86,33 @@ linters:
83
86
text: "Conditions field must be a slice of metav1.Condition"
// extraEnvs is an extra set of environment variables to pass to the control plane component.
206
209
// Environment variables passed using ExtraEnvs will override any existing environment variables, or *_proxy environment variables that kubeadm adds by default.
207
210
// This option takes effect only on Kubernetes >=1.31.0.
208
211
// +optional
212
+
// +listType=atomic
209
213
// +kubebuilder:validation:MaxItems=100
210
214
ExtraEnvs []EnvVar`json:"extraEnvs,omitempty"`
211
215
212
216
// certSANs sets extra Subject Alternative Names for the API Server signing cert.
213
217
// +optional
218
+
// +listType=atomic
214
219
// +kubebuilder:validation:MaxItems=100
215
220
// +kubebuilder:validation:items:MinLength=1
216
221
// +kubebuilder:validation:items:MaxLength=253
@@ -234,13 +239,15 @@ type ControllerManager struct {
234
239
235
240
// extraVolumes is an extra set of host volumes, mounted to the control plane component.
// extraEnvs is an extra set of environment variables to pass to the control plane component.
241
247
// Environment variables passed using ExtraEnvs will override any existing environment variables, or *_proxy environment variables that kubeadm adds by default.
242
248
// This option takes effect only on Kubernetes >=1.31.0.
243
249
// +optional
250
+
// +listType=atomic
244
251
// +kubebuilder:validation:MaxItems=100
245
252
ExtraEnvs []EnvVar`json:"extraEnvs,omitempty"`
246
253
}
@@ -262,13 +269,15 @@ type Scheduler struct {
262
269
263
270
// extraVolumes is an extra set of host volumes, mounted to the control plane component.
// extraEnvs is an extra set of environment variables to pass to the control plane component.
269
277
// Environment variables passed using ExtraEnvs will override any existing environment variables, or *_proxy environment variables that kubeadm adds by default.
270
278
// This option takes effect only on Kubernetes >=1.31.0.
271
279
// +optional
280
+
// +listType=atomic
272
281
// +kubebuilder:validation:MaxItems=100
273
282
ExtraEnvs []EnvVar`json:"extraEnvs,omitempty"`
274
283
}
@@ -357,6 +366,7 @@ type NodeRegistrationOptions struct {
357
366
// ignorePreflightErrors provides a slice of pre-flight errors to be ignored when the current node is registered, e.g. 'IsPrivilegedUser,Swap'.
358
367
// Value 'all' ignores errors from all checks.
359
368
// +optional
369
+
// +listType=atomic
360
370
// +kubebuilder:validation:MaxItems=50
361
371
// +kubebuilder:validation:items:MinLength=1
362
372
// +kubebuilder:validation:items:MaxLength=512
@@ -383,31 +393,38 @@ type BootstrapToken struct {
383
393
// Used for joining nodes in the cluster.
384
394
// +required
385
395
Token*BootstrapTokenString`json:"token"`
396
+
386
397
// description sets a human-friendly message why this token exists and what it's used
387
398
// for, so other administrators can know its purpose.
388
399
// +optional
389
400
// +kubebuilder:validation:MinLength=1
390
401
// +kubebuilder:validation:MaxLength=512
391
402
Descriptionstring`json:"description,omitempty"`
403
+
392
404
// ttlSeconds defines the time to live for this token. Defaults to 24h.
393
405
// Expires and ttlSeconds are mutually exclusive.
394
406
// +optional
395
407
// +kubebuilder:validation:Minimum=0
396
408
TTLSeconds*int32`json:"ttlSeconds,omitempty"`
409
+
397
410
// expires specifies the timestamp when this token expires. Defaults to being set
398
411
// dynamically at runtime based on the ttlSeconds. Expires and ttlSeconds are mutually exclusive.
399
412
// +optional
400
413
Expires*metav1.Time`json:"expires,omitempty"`
414
+
401
415
// usages describes the ways in which this token can be used. Can by default be used
402
416
// for establishing bidirectional trust, but that can be changed here.
403
417
// +optional
418
+
// +listType=atomic
404
419
// +kubebuilder:validation:MaxItems=100
405
420
// +kubebuilder:validation:items:MinLength=1
406
421
// +kubebuilder:validation:items:MaxLength=256
407
422
Usages []string`json:"usages,omitempty"`
423
+
408
424
// groups specifies the extra groups that this token will authenticate as when/if
409
425
// used for authentication
410
426
// +optional
427
+
// +listType=atomic
411
428
// +kubebuilder:validation:MaxItems=100
412
429
// +kubebuilder:validation:items:MinLength=1
413
430
// +kubebuilder:validation:items:MaxLength=256
@@ -456,18 +473,21 @@ type LocalEtcd struct {
456
473
// Environment variables passed using ExtraEnvs will override any existing environment variables, or *_proxy environment variables that kubeadm adds by default.
457
474
// This option takes effect only on Kubernetes >=1.31.0.
458
475
// +optional
476
+
// +listType=atomic
459
477
// +kubebuilder:validation:MaxItems=100
460
478
ExtraEnvs []EnvVar`json:"extraEnvs,omitempty"`
461
479
462
480
// serverCertSANs sets extra Subject Alternative Names for the etcd server signing cert.
0 commit comments