mark ContainerImage.names as optional

kubelet is the only writer of v1.Node .status.images[].names. When an
image has neither RepoDigests nor RepoTags, the value gets stored in
etcd as null. Marking the field as optional can help JSON API clients
to avoid hitting serialization error when the returned status contains
null .status.images[].names.
This commit is contained in:
Haowei Cai 2021-05-19 17:05:42 -07:00
parent 3cc0ca0988
commit 1652e59c9b
2 changed files with 2 additions and 0 deletions

View File

@ -4206,6 +4206,7 @@ type PodSignature struct {
// ContainerImage describe a container image
type ContainerImage struct {
// Names by which this image is known.
// +optional
Names []string
// The size of the image in bytes.
// +optional

View File

@ -4872,6 +4872,7 @@ type PodSignature struct {
type ContainerImage struct {
// Names by which this image is known.
// e.g. ["k8s.gcr.io/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"]
// +optional
Names []string `json:"names" protobuf:"bytes,1,rep,name=names"`
// The size of the image in bytes.
// +optional