From a10ff53d8e60f35a974e3e6d15ca6ab1c9401fe8 Mon Sep 17 00:00:00 2001 From: Tomas Tormo Date: Thu, 18 May 2023 15:43:59 +0200 Subject: [PATCH] Reword the event message to read better for a single secret Co-authored-by: Steven E. Harris --- pkg/kubelet/kubelet_pods.go | 2 +- pkg/kubelet/kubelet_pods_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/kubelet/kubelet_pods.go b/pkg/kubelet/kubelet_pods.go index 866d438bd06..f2f99efce52 100644 --- a/pkg/kubelet/kubelet_pods.go +++ b/pkg/kubelet/kubelet_pods.go @@ -895,7 +895,7 @@ func (kl *Kubelet) getPullSecretsForPod(pod *v1.Pod) []v1.Secret { } if len(failedPullSecrets) > 0 { - kl.recorder.Eventf(pod, v1.EventTypeWarning, "FailedToRetrieveImagePullSecret", "Unable to retrieve image pull secrets %s; attempting to pull the image may not succeed.", strings.Join(failedPullSecrets, ", ")) + kl.recorder.Eventf(pod, v1.EventTypeWarning, "FailedToRetrieveImagePullSecret", "Unable to retrieve some image pull secrets (%s); attempting to pull the image may not succeed.", strings.Join(failedPullSecrets, ", ")) } return pullSecrets diff --git a/pkg/kubelet/kubelet_pods_test.go b/pkg/kubelet/kubelet_pods_test.go index cbb21f564c7..ca1ee492feb 100644 --- a/pkg/kubelet/kubelet_pods_test.go +++ b/pkg/kubelet/kubelet_pods_test.go @@ -5406,7 +5406,8 @@ func TestGetNonExistentImagePullSecret(t *testing.T) { testKubelet.kubelet.secretManager = secret.NewFakeManagerWithSecrets(secrets) defer testKubelet.Cleanup() - expectedEvent := "Warning FailedToRetrieveImagePullSecret Unable to retrieve image pull secrets secretFoo; attempting to pull the image may not succeed." + expectedEvent := "Warning FailedToRetrieveImagePullSecret Unable to retrieve some image pull secrets (secretFoo); attempting to pull the image may not succeed." + testPod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Namespace: "nsFoo",