File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
pkg/cloudprovider/vsphereparavirtual Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -129,10 +129,9 @@ func getRestConfig(svConfigPath string) (*rest.Config, error) {
129129 }
130130
131131 return & rest.Config {
132- Host : "https://" + net .JoinHostPort (svEndpoint . Endpoint , svEndpoint .Port ),
132+ Host : "https://" + net .JoinHostPort (SupervisorAPIServerFQDN , svEndpoint .Port ),
133133 TLSClientConfig : rest.TLSClientConfig {
134- CAData : rootCA ,
135- ServerName : SupervisorAPIServerFQDN ,
134+ CAData : rootCA ,
136135 },
137136 BearerToken : string (token ),
138137 }, nil
Original file line number Diff line number Diff line change @@ -186,21 +186,24 @@ func TestGetNameSpace(t *testing.T) {
186186func TestGetRestConfig (t * testing.T ) {
187187 tests := []struct {
188188 fileExists bool
189+ fqdn string
189190 endpoint string
190191 port string
191192 token string
192193 ca string
193194 }{
194195 {
195196 fileExists : false ,
196- endpoint : "test.sv.proxy" ,
197+ fqdn : "supervisor.default.svc" ,
198+ endpoint : "192.163.1.100" ,
197199 port : "6443" ,
198200 token : "test-token" ,
199201 ca : "test-ca" ,
200202 },
201203 {
202204 fileExists : true ,
203- endpoint : "test.sv.proxy" ,
205+ fqdn : "supervisor.default.svc" ,
206+ endpoint : "192.163.1.200" ,
204207 port : "6443" ,
205208 token : "test-token" ,
206209 ca : "test-ca" ,
@@ -240,7 +243,7 @@ func TestGetRestConfig(t *testing.T) {
240243 if err != nil {
241244 t .Fatalf ("Should succeed when a valid SV endpoint config is provided: %s" , err )
242245 }
243- if cfg .Host != "https://" + net .JoinHostPort (test .endpoint , test .port ) {
246+ if cfg .Host != "https://" + net .JoinHostPort (test .fqdn , test .port ) {
244247 t .Fatalf ("incorrect Host: %s" , cfg .Host )
245248 }
246249 if cfg .BearerToken != test .token {
You can’t perform that action at this time.
0 commit comments