Commit 60310ce0 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

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
parents c826c5a1 515987db
...@@ -51,7 +51,7 @@ func MakeCSRFromTemplate(privateKey interface{}, template *x509.CertificateReque ...@@ -51,7 +51,7 @@ func MakeCSRFromTemplate(privateKey interface{}, template *x509.CertificateReque
} }
csrPemBlock := &pem.Block{ csrPemBlock := &pem.Block{
Type: "CERTIFICATE REQUEST", Type: CertificateRequestBlockType,
Bytes: csrDER, Bytes: csrDER,
} }
......
...@@ -52,7 +52,7 @@ func TestMakeCSR(t *testing.T) { ...@@ -52,7 +52,7 @@ func TestMakeCSR(t *testing.T) {
if len(rest) != 0 { if len(rest) != 0 {
t.Error("Found more than one PEM encoded block in the result.") 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) t.Errorf("Found block type %q, wanted 'CERTIFICATE REQUEST'", csrBlock.Type)
} }
csr, err := x509.ParseCertificateRequest(csrBlock.Bytes) csr, err := x509.ParseCertificateRequest(csrBlock.Bytes)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment