mirror of
https://github.com/wahyd4/cert-manager.git
synced 2026-08-09 13:16:20 +10:00
Use bytes.Equal instead of bytes.Compare
pkg/webhook/server/tls/file_source.go:140:5: should use bytes.Equal(keyData, f.cachedKeyBytes) instead (S1004) pkg/webhook/server/tls/file_source.go:140:54: should use bytes.Equal(certData, f.cachedCertBytes) instead (S1004) Signed-off-by: Richard Wall <richard.wall@jetstack.io>
This commit is contained in:
@@ -137,7 +137,7 @@ func (f *FileCertificateSource) updateCertificateFromDisk() error {
|
||||
|
||||
f.lock.Lock()
|
||||
defer f.lock.Unlock()
|
||||
if bytes.Compare(keyData, f.cachedKeyBytes) == 0 && bytes.Compare(certData, f.cachedCertBytes) == 0 {
|
||||
if bytes.Equal(keyData, f.cachedKeyBytes) && bytes.Equal(certData, f.cachedCertBytes) {
|
||||
f.Log.V(logf.DebugLevel).Info("key and certificate on disk have not changed")
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user