Fix panic on nil secret (#204)

Use configured secret namespace/name in error message, to avoid panicing if the secret is invalid because it is nil

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
Brad Davidson
2025-09-12 14:11:40 -07:00
committed by GitHub
parent 63a9f346f9
commit d9174a1f59

View File

@@ -212,7 +212,7 @@ func (s *storage) saveInK8s(secret *v1.Secret) (*v1.Secret, error) {
// ensure that the merged secret actually contains data before overwriting the existing fields
if !cert.IsValidTLSSecret(secret) {
logrus.Warnf("Skipping save of TLS secret for %s/%s due to missing certificate data", secret.Namespace, secret.Name)
logrus.Warnf("Skipping save of TLS secret for %s/%s due to missing certificate data", s.namespace, s.name)
return targetSecret, nil
}