diff --git a/pkg/api/util/names.go b/pkg/api/util/names.go index 3208e32c0..5a2de69be 100644 --- a/pkg/api/util/names.go +++ b/pkg/api/util/names.go @@ -21,8 +21,9 @@ import ( "fmt" "hash/fnv" + "regexp" + cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1alpha2" - "gopkg.in/src-d/enry.v1/regex" ) func ComputeCertificateRequestName(crt *cmapi.Certificate) (string, error) { @@ -42,7 +43,7 @@ func ComputeCertificateRequestName(crt *cmapi.Certificate) (string, error) { // shorten the cert name to 52 chars to ensure the total length of the name // also shorten the 52 char string to the last non-symbol character // is less than or equal to 64 characters - validCharIndexes := regex.MustCompile(`[a-zA-Z\d]`).FindAllStringIndex(fmt.Sprintf("%.52s", crt.Name), -1) + validCharIndexes := regexp.MustCompile(`[a-zA-Z\d]`).FindAllStringIndex(fmt.Sprintf("%.52s", crt.Name), -1) crt.Name = crt.Name[:validCharIndexes[len(validCharIndexes)-1][1]] }