mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-11 14:09:21 +00:00
chore: checking error
This commit is contained in:
parent
f8e9196791
commit
3b00739e62
1 changed files with 9 additions and 2 deletions
|
|
@ -72,9 +72,16 @@ func (r SchemaRegistry) DownloadSchema(resourceKind, resourceAPIVersion, k8sVers
|
|||
return url, b.([]byte), nil
|
||||
}
|
||||
}
|
||||
req, _ := http.NewRequest("GET", url, nil)
|
||||
req, err := http.NewRequest("GET", url, nil)
|
||||
if err != nil {
|
||||
msg := fmt.Sprintf("failed to create http request for schemas at %s: %s", url, err)
|
||||
if r.debug {
|
||||
log.Println(msg)
|
||||
}
|
||||
return url, nil, errors.New(msg)
|
||||
}
|
||||
|
||||
if token, exist := os.LookupEnv("GITHUB_TOKEN"); exist {
|
||||
if token, exist := os.LookupEnv("KUBECONFORM_AUTH_TOKEN"); exist {
|
||||
req.Header.Add("Authorization", fmt.Sprintf("token %s", token))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue