mirror of
https://github.com/kairos-io/kairos-sdk.git
synced 2025-09-17 15:52:12 +00:00
fix: adjust error handling in collector (#622)
This commit is contained in:
@@ -457,19 +457,12 @@ func fetchRemoteConfig(url string) (*Config, error) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// TODO: improve logging
|
// TODO: This keeps the old behaviour but IMHO we should return an error here
|
||||||
fmt.Printf("WARNING: Couldn't fetch config_url: %s", err)
|
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if !HasValidHeader(string(body)) {
|
if !HasValidHeader(string(body)) {
|
||||||
// TODO: Print a warning when we implement proper logging
|
// TODO: This keeps the old behaviour but IMHO we should return an error here
|
||||||
if err != nil {
|
|
||||||
fmt.Printf("No valid header in remote config: %s\n", err.Error())
|
|
||||||
} else {
|
|
||||||
fmt.Println("No valid header in remote config")
|
|
||||||
}
|
|
||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user