Compare commits

..

2 Commits

Author SHA1 Message Date
Brad Davidson
7ad41853e0 Do not update memory storage with a nil secret (#205)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2025-09-15 11:19:38 -07:00
Brad Davidson
d9174a1f59 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>
2025-09-12 14:11:40 -07:00
2 changed files with 4 additions and 1 deletions

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
}

View File

@@ -47,6 +47,9 @@ func (m *memory) Update(secret *v1.Secret) error {
}
func isChanged(old, new *v1.Secret) bool {
if new == nil {
return false
}
if old == nil {
return true
}