join client CA bundles into the accept path for genericapiserver

This commit is contained in:
deads2k
2016-12-05 15:30:13 -05:00
parent fbb35b72ed
commit 6ea1d5d53d
7 changed files with 46 additions and 22 deletions

View File

@@ -90,7 +90,7 @@ func WriteKey(keyPath string, data []byte) error {
// NewPool returns an x509.CertPool containing the certificates in the given PEM-encoded file.
// Returns an error if the file could not be read, a certificate could not be parsed, or if the file does not contain any certificates
func NewPool(filename string) (*x509.CertPool, error) {
certs, err := certsFromFile(filename)
certs, err := CertsFromFile(filename)
if err != nil {
return nil, err
}
@@ -101,9 +101,9 @@ func NewPool(filename string) (*x509.CertPool, error) {
return pool, nil
}
// certsFromFile returns the x509.Certificates contained in the given PEM-encoded file.
// CertsFromFile returns the x509.Certificates contained in the given PEM-encoded file.
// Returns an error if the file could not be read, a certificate could not be parsed, or if the file does not contain any certificates
func certsFromFile(file string) ([]*x509.Certificate, error) {
func CertsFromFile(file string) ([]*x509.Certificate, error) {
if len(file) == 0 {
return nil, errors.New("error reading certificates from an empty filename")
}