Skip to content

Commit

Permalink
BUG/MINOR: fix nil pointer in refreshCerts
Browse files Browse the repository at this point in the history
If the certificate file exists, but is not in use, crt is nil and instance.Reload panics
panic: runtime error: invalid memory address or nil pointer dereference
  • Loading branch information
hdurand0710 committed May 15, 2024
1 parent 3237d80 commit c3cd22c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/haproxy/certs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func refreshCerts(certs map[string]*cert, certDir string) {
if !crtOk || !crt.inUse {
logger.Error(os.Remove(path.Join(certDir, filename)))
delete(certs, certName)
instance.Reload("secret %s removed", crt.name)
instance.Reload("secret %s removed", certName)
}
}
}
Expand Down

0 comments on commit c3cd22c

Please sign in to comment.