Skip to content

Commit

Permalink
Merge pull request #126046 from mimowo/fix-job-pod-failure-api
Browse files Browse the repository at this point in the history
Use omitempty for optional fields in Job Pod Failure Policy
  • Loading branch information
k8s-ci-robot authored Jul 12, 2024
2 parents 0a3330d + f523be6 commit d11e860
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions staging/src/k8s.io/api/batch/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ type PodFailurePolicyOnExitCodesRequirement struct {
// When specified, it should match one the container or initContainer
// names in the pod template.
// +optional
ContainerName *string `json:"containerName" protobuf:"bytes,1,opt,name=containerName"`
ContainerName *string `json:"containerName,omitempty" protobuf:"bytes,1,opt,name=containerName"`

// Represents the relationship between the container exit code(s) and the
// specified values. Containers completed with success (exit code 0) are
Expand Down Expand Up @@ -236,14 +236,14 @@ type PodFailurePolicyRule struct {

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

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

// PodFailurePolicy describes how failed pods influence the backoffLimit.
Expand Down

0 comments on commit d11e860

Please sign in to comment.