mirror of https://github.com/kubernetes/kops.git
Improve comments
This commit is contained in:
parent
d64e760d5b
commit
7ed41a6d5a
|
|
@ -36,7 +36,7 @@ var wellKnownCertificateTypes = map[string]string{
|
||||||
}
|
}
|
||||||
|
|
||||||
type IssueCertRequest struct {
|
type IssueCertRequest struct {
|
||||||
// Signer is the keypair to use to sign.
|
// Signer is the keypair to use to sign. Ignored if Type is "CA", in which case the cert will be self-signed.
|
||||||
Signer string
|
Signer string
|
||||||
// Type is the type of certificate i.e. CA, server, client etc.
|
// Type is the type of certificate i.e. CA, server, client etc.
|
||||||
Type string
|
Type string
|
||||||
|
|
@ -65,7 +65,8 @@ type Keystore interface {
|
||||||
FindKeypair(name string) (*Certificate, *PrivateKey, bool, error)
|
FindKeypair(name string) (*Certificate, *PrivateKey, bool, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func IssueCert(request *IssueCertRequest, keystore Keystore) (*Certificate, *PrivateKey, *Certificate, error) {
|
// IssueCert issues a certificate, either a self-signed CA or from a CA in a keystore.
|
||||||
|
func IssueCert(request *IssueCertRequest, keystore Keystore) (issuedCertificate *Certificate, issuedKey *PrivateKey, caCertificate *Certificate, err error) {
|
||||||
certificateType := request.Type
|
certificateType := request.Type
|
||||||
if expanded, found := wellKnownCertificateTypes[certificateType]; found {
|
if expanded, found := wellKnownCertificateTypes[certificateType]; found {
|
||||||
certificateType = expanded
|
certificateType = expanded
|
||||||
|
|
@ -115,7 +116,6 @@ func IssueCert(request *IssueCertRequest, keystore Keystore) (*Certificate, *Pri
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var caCertificate *Certificate
|
|
||||||
var caPrivateKey *PrivateKey
|
var caPrivateKey *PrivateKey
|
||||||
var signer *x509.Certificate
|
var signer *x509.Certificate
|
||||||
if !template.IsCA {
|
if !template.IsCA {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue