mirror of
https://github.com/kairos-io/kairos-sdk.git
synced 2025-09-17 07:41:14 +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 {
|
||||
// TODO: improve logging
|
||||
fmt.Printf("WARNING: Couldn't fetch config_url: %s", err)
|
||||
// TODO: This keeps the old behaviour but IMHO we should return an error here
|
||||
return result, nil
|
||||
}
|
||||
|
||||
if !HasValidHeader(string(body)) {
|
||||
// TODO: Print a warning when we implement proper logging
|
||||
if err != nil {
|
||||
fmt.Printf("No valid header in remote config: %s\n", err.Error())
|
||||
} else {
|
||||
fmt.Println("No valid header in remote config")
|
||||
}
|
||||
|
||||
// TODO: This keeps the old behaviour but IMHO we should return an error here
|
||||
return result, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user