ImagePulledRecord API: don't serialize nulls

Signed-off-by: Stanislav Láznička <slznika@microsoft.com>
This commit is contained in:
Stanislav Láznička
2025-07-09 14:52:09 +02:00
committed by Stanislav Láznička
parent 99ceb20173
commit bb82225998
3 changed files with 3 additions and 3 deletions

View File

@@ -1 +1 @@
{"kind":"ImagePulledRecord","apiVersion":"kubelet.config.k8s.io/v1alpha1","lastUpdatedTime":"2025-06-21T12:26:40Z","imageRef":"testimage-anonpull-alpha","credentialMapping":{"docker.io/testing/test":{"kubernetesSecrets":null,"nodePodsAccessible":true}}}
{"kind":"ImagePulledRecord","apiVersion":"kubelet.config.k8s.io/v1alpha1","lastUpdatedTime":"2025-06-21T12:26:40Z","imageRef":"testimage-anonpull-alpha","credentialMapping":{"docker.io/testing/test":{"nodePodsAccessible":true}}}

View File

@@ -147,7 +147,7 @@ type ImagePullCredentials struct {
// secrets that were used to pull the image.
// +optional
// +listType=set
KubernetesSecrets []ImagePullSecret `json:"kubernetesSecrets"`
KubernetesSecrets []ImagePullSecret `json:"kubernetesSecrets,omitempty"`
// KubernetesServiceAccounts is an index of coordinates of all the kubernetes
// service accounts that were used to pull the image.

View File

@@ -1186,7 +1186,7 @@ type ImagePullCredentials struct {
// secrets that were used to pull the image.
// +optional
// +listType=set
KubernetesSecrets []ImagePullSecret `json:"kubernetesSecrets"`
KubernetesSecrets []ImagePullSecret `json:"kubernetesSecrets,omitempty"`
// KubernetesServiceAccounts is an index of coordinates of all the kubernetes
// service accounts that were used to pull the image.