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:
committed by
Darren Shepherd
parent
ee25c89cfd
commit
a978cad0e8
@@ -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
|
||||
|
Reference in New Issue
Block a user