From f503ec43c708b7aa54e44ceccadeea6bc1df17f2 Mon Sep 17 00:00:00 2001 From: Jacob Simpson Date: Thu, 9 Mar 2017 16:48:11 -0800 Subject: [PATCH] Change the PEM block type to use the constant Kubernetes-commit: 515987db3f039f5f19c3f6292af072b937aacdd7 --- util/cert/csr.go | 2 +- util/cert/csr_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/util/cert/csr.go b/util/cert/csr.go index 280d249f..39a6751f 100644 --- a/util/cert/csr.go +++ b/util/cert/csr.go @@ -51,7 +51,7 @@ func MakeCSRFromTemplate(privateKey interface{}, template *x509.CertificateReque } csrPemBlock := &pem.Block{ - Type: "CERTIFICATE REQUEST", + Type: CertificateRequestBlockType, Bytes: csrDER, } diff --git a/util/cert/csr_test.go b/util/cert/csr_test.go index c2a0bbb3..ed28f021 100644 --- a/util/cert/csr_test.go +++ b/util/cert/csr_test.go @@ -52,7 +52,7 @@ func TestMakeCSR(t *testing.T) { if len(rest) != 0 { t.Error("Found more than one PEM encoded block in the result.") } - if csrBlock.Type != "CERTIFICATE REQUEST" { + if csrBlock.Type != CertificateRequestBlockType { t.Errorf("Found block type %q, wanted 'CERTIFICATE REQUEST'", csrBlock.Type) } csr, err := x509.ParseCertificateRequest(csrBlock.Bytes)