Skip to content

Commit

Permalink
api: fix ValidatingAdmissionPolicyList json tag
Browse files Browse the repository at this point in the history
This change make api-server not omity the field `item` of
ValidatingAdmissionPolicyList when ValidatingAdmissionPolicy is empty.
So kubetl will print ValidatingAdmissionPolicyList correctly when ValidatingAdmissionPolicy is empty.

Signed-off-by: xyz-li <[email protected]>

Kubernetes-commit: f454cd38f72e1462311749ee39fbce8a56dd910c
  • Loading branch information
xyz-li authored and k8s-publishing-bot committed Jul 17, 2024
1 parent 7c71f3c commit 0e08277
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions admissionregistration/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ type ValidatingAdmissionPolicyList struct {
// +optional
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// List of ValidatingAdmissionPolicy.
Items []ValidatingAdmissionPolicy `json:"items,omitempty" protobuf:"bytes,2,rep,name=items"`
Items []ValidatingAdmissionPolicy `json:"items" protobuf:"bytes,2,rep,name=items"`
}

// ValidatingAdmissionPolicySpec is the specification of the desired behavior of the AdmissionPolicy.
Expand Down Expand Up @@ -404,7 +404,7 @@ type ValidatingAdmissionPolicyBindingList struct {
// +optional
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// List of PolicyBinding.
Items []ValidatingAdmissionPolicyBinding `json:"items,omitempty" protobuf:"bytes,2,rep,name=items"`
Items []ValidatingAdmissionPolicyBinding `json:"items" protobuf:"bytes,2,rep,name=items"`
}

// ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding.
Expand Down
4 changes: 2 additions & 2 deletions admissionregistration/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ type ValidatingAdmissionPolicyList struct {
// +optional
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// List of ValidatingAdmissionPolicy.
Items []ValidatingAdmissionPolicy `json:"items,omitempty" protobuf:"bytes,2,rep,name=items"`
Items []ValidatingAdmissionPolicy `json:"items" protobuf:"bytes,2,rep,name=items"`
}

// ValidatingAdmissionPolicySpec is the specification of the desired behavior of the AdmissionPolicy.
Expand Down Expand Up @@ -419,7 +419,7 @@ type ValidatingAdmissionPolicyBindingList struct {
// +optional
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// List of PolicyBinding.
Items []ValidatingAdmissionPolicyBinding `json:"items,omitempty" protobuf:"bytes,2,rep,name=items"`
Items []ValidatingAdmissionPolicyBinding `json:"items" protobuf:"bytes,2,rep,name=items"`
}

// ValidatingAdmissionPolicyBindingSpec is the specification of the ValidatingAdmissionPolicyBinding.
Expand Down

0 comments on commit 0e08277

Please sign in to comment.