Make const private.
This commit is contained in:
Lantao Liu 2018-03-22 18:31:04 -07:00 committed by GitHub
commit c63c357d2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,10 +43,10 @@ import (
) )
const ( const (
// OrganizationName is is the name of this organization, used for certificates etc. // certOrganizationName is the name of this organization, used for certificates etc.
OrganizationName = "containerd" certOrganizationName = "containerd"
// CRIName is the common name of the CRI plugin // certCommonName is the common name of the CRI plugin
CRIName = "cri" certCommonName = "cri"
) )
func newStreamServer(c *criService, addr, port string) (streaming.Server, error) { func newStreamServer(c *criService, addr, port string) (streaming.Server, error) {
@ -182,8 +182,8 @@ func newTLSCert() (tls.Certificate, error) {
NotAfter: time.Now().AddDate(years, 0, 0), NotAfter: time.Now().AddDate(years, 0, 0),
SerialNumber: serialNumber, SerialNumber: serialNumber,
Subject: pkix.Name{ Subject: pkix.Name{
CommonName: fmt.Sprintf("%s:%s:%s", OrganizationName, CRIName, hostName), CommonName: fmt.Sprintf("%s:%s:%s", certOrganizationName, certCommonName, hostName),
Organization: []string{OrganizationName}, Organization: []string{certOrganizationName},
}, },
BasicConstraintsValid: true, BasicConstraintsValid: true,
} }