Skip to content

Commit b231ddb

Browse files
committed
APIServer in envtest should expose TLSClientConfig so that user can connect 'https' endpoint of kube-apiserver
1 parent 587ca7c commit b231ddb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/internal/testing/integration/apiserver.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55
"io"
66
"io/ioutil"
7+
"k8s.io/client-go/rest"
78
"net/url"
89
"os"
910
"path/filepath"
@@ -23,6 +24,9 @@ type APIServer struct {
2324
// SecurePort is the additional secure port that the APIServer should listen on.
2425
SecurePort int
2526

27+
// TLSconfig is tls configuration to connect to its secure endpoint.
28+
TlsClientConfig rest.TLSClientConfig
29+
2630
// Path is the path to the apiserver binary.
2731
//
2832
// If this is left as the empty string, we will attempt to locate a binary,
@@ -157,6 +161,10 @@ func (s *APIServer) populateAPIServerCerts() error {
157161
return err
158162
}
159163

164+
s.TlsClientConfig = rest.TLSClientConfig{
165+
CAData: ca.CA.CertBytes(),
166+
}
167+
160168
return nil
161169
}
162170

0 commit comments

Comments
 (0)