From 894208591eaa0281e5f70bb64be43c60eb52c49f Mon Sep 17 00:00:00 2001 From: Raphael 'kena' Poss Date: Mon, 30 May 2022 18:25:39 +0200 Subject: [PATCH] certnames: rename IsCertificateFile to IsCertificateFilename ... since the function does not actually look at the contents of the file. Release note: None --- pkg/security/certificate_loader.go | 2 +- pkg/security/certnames/certnames.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/security/certificate_loader.go b/pkg/security/certificate_loader.go index bad60602f17b..5f14ff698b7e 100644 --- a/pkg/security/certificate_loader.go +++ b/pkg/security/certificate_loader.go @@ -301,7 +301,7 @@ func (cl *CertificateLoader) Load() error { continue } - if !certnames.IsCertificateFile(filename) { + if !certnames.IsCertificateFilename(filename) { if log.V(3) { log.Infof(context.Background(), "skipping non-certificate file %s", filename) } diff --git a/pkg/security/certnames/certnames.go b/pkg/security/certnames/certnames.go index df844e8580ac..77ce713acd86 100644 --- a/pkg/security/certnames/certnames.go +++ b/pkg/security/certnames/certnames.go @@ -21,8 +21,8 @@ const ( keyExtension = `.key` ) -// IsCertificateFile returns true if the file name looks like a certificate file. -func IsCertificateFile(filename string) bool { +// IsCertificateFilename returns true if the file name looks like a certificate file. +func IsCertificateFilename(filename string) bool { return strings.HasSuffix(filename, certExtension) }