Merge pull request #42860 from jcbsmpsn/change-pem-type-to-constant

Automatic merge from submit-queue

Change the PEM block type to use the constant
pull/6/head
Kubernetes Submit Queue 2017-04-11 11:24:27 -07:00 committed by GitHub
commit 60310ce0f7
2 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ func MakeCSRFromTemplate(privateKey interface{}, template *x509.CertificateReque
}
csrPemBlock := &pem.Block{
Type: "CERTIFICATE REQUEST",
Type: CertificateRequestBlockType,
Bytes: csrDER,
}

View File

@ -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)