Reword the event message to read better for a single secret

Co-authored-by: Steven E. Harris <seh@panix.com>
This commit is contained in:
Tomas Tormo 2023-05-18 15:43:59 +02:00 committed by Tomas Tormo
parent 5a75a03a77
commit a10ff53d8e
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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",