Skip to content

Commit 7c0a335

Browse files
mimowok8s-publishing-bot
authored andcommittedJul 12, 2024
Use omitempty for optional fields in Job Pod Failure Policy
Kubernetes-commit: 877e3e49a4aedd5773b24c4ff77ac76395f76ac3
1 parent 0fd470c commit 7c0a335

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

Diff for: ‎batch/v1/types.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ type PodFailurePolicyOnExitCodesRequirement struct {
174174
// When specified, it should match one the container or initContainer
175175
// names in the pod template.
176176
// +optional
177-
ContainerName *string `json:"containerName" protobuf:"bytes,1,opt,name=containerName"`
177+
ContainerName *string `json:"containerName,omitempty" protobuf:"bytes,1,opt,name=containerName"`
178178

179179
// Represents the relationship between the container exit code(s) and the
180180
// specified values. Containers completed with success (exit code 0) are
@@ -234,14 +234,14 @@ type PodFailurePolicyRule struct {
234234

235235
// Represents the requirement on the container exit codes.
236236
// +optional
237-
OnExitCodes *PodFailurePolicyOnExitCodesRequirement `json:"onExitCodes" protobuf:"bytes,2,opt,name=onExitCodes"`
237+
OnExitCodes *PodFailurePolicyOnExitCodesRequirement `json:"onExitCodes,omitempty" protobuf:"bytes,2,opt,name=onExitCodes"`
238238

239239
// Represents the requirement on the pod conditions. The requirement is represented
240240
// as a list of pod condition patterns. The requirement is satisfied if at
241241
// least one pattern matches an actual pod condition. At most 20 elements are allowed.
242242
// +listType=atomic
243243
// +optional
244-
OnPodConditions []PodFailurePolicyOnPodConditionsPattern `json:"onPodConditions" protobuf:"bytes,3,opt,name=onPodConditions"`
244+
OnPodConditions []PodFailurePolicyOnPodConditionsPattern `json:"onPodConditions,omitempty" protobuf:"bytes,3,opt,name=onPodConditions"`
245245
}
246246

247247
// PodFailurePolicy describes how failed pods influence the backoffLimit.

0 commit comments

Comments
 (0)
Please sign in to comment.