1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-09 02:59:19 +00:00

add insecure flag, fix collection link, add yaml tags

This commit is contained in:
Daishan Peng
2018-02-13 16:21:22 -07:00
committed by Darren Shepherd
parent ee25c89cfd
commit a978cad0e8
4 changed files with 24 additions and 16 deletions

View File

@@ -36,6 +36,7 @@ type ClientOpts struct {
Timeout time.Duration
HTTPClient *http.Client
CACerts string
Insecure bool
}
func (c *ClientOpts) getAuthHeader() string {
@@ -176,6 +177,15 @@ func NewAPIClient(opts *ClientOpts) (APIBaseClient, error) {
client.Transport = tr
}
if opts.Insecure {
tr := &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: opts.Insecure,
},
}
client.Transport = tr
}
req, err := http.NewRequest("GET", opts.URL, nil)
if err != nil {
return result, err