@@ -57,6 +57,10 @@ func NewClientFromCluster(ctrlClient client.Client, openStackCluster *infrav1.Op
5757 return newClient (cloud , caCert )
5858}
5959
60+ // TODO(sbueringer) find out if this function does what we want
61+ // e.g. it had a bug where it didn't use the verify option of the
62+ // cloud parameter. Does it read the ca property from the paramenter?
63+ // how can a CA be set via secret? (an additional key?)
6064func newClient (cloud clientconfig.Cloud , caCert []byte ) (* gophercloud.ProviderClient , * clientconfig.ClientOpts , error ) {
6165 clientOpts := new (clientconfig.ClientOpts )
6266 if cloud .AuthInfo != nil {
@@ -86,14 +90,16 @@ func newClient(cloud clientconfig.Cloud, caCert []byte) (*gophercloud.ProviderCl
8690 config .RootCAs = caCertPool
8791 }
8892 config .InsecureSkipVerify = ! * cloudFromYaml .Verify
93+ } else {
94+ config .InsecureSkipVerify = ! * cloud .Verify
8995 }
9096
9197 transport := & http.Transport {Proxy : http .ProxyFromEnvironment , TLSClientConfig : config }
9298 provider .HTTPClient .Transport = transport
9399
94100 err = openstack .Authenticate (provider , * opts )
95101 if err != nil {
96- return nil , nil , fmt .Errorf ("providerClient authentication err: %v" , err )
102+ return nil , nil , fmt .Errorf ("providerClient authentication err: %v, %+v " , err , cloudFromYaml )
97103 }
98104 return provider , clientOpts , nil
99105}
0 commit comments