fix(): also drop api server response to debug in case there are no errors
This commit is contained in:
@@ -91,13 +91,18 @@ func RecreateIPPoolCrd(cfg *Config, name string, ips []string) error {
|
||||
var status int
|
||||
res.StatusCode(&status)
|
||||
|
||||
raw, rawErr := res.Raw()
|
||||
|
||||
if status < 200 || status >= 400 {
|
||||
log.WithFields(log.Fields{
|
||||
"Caller": "RecreateIPPoolCrd",
|
||||
}).Warnf("Response from k8s api server: %s", string(raw))
|
||||
return fmt.Errorf("failed to post CRD to kube api: %v", res.Error())
|
||||
}
|
||||
raw, rawErr := res.Raw()
|
||||
|
||||
log.WithFields(log.Fields{
|
||||
"Caller": "RecreateIPPoolCrd",
|
||||
}).Infof("Response from k8s api server: %s", string(raw))
|
||||
}).Debugf("Response from k8s api server: %s", string(raw))
|
||||
|
||||
if rawErr != nil {
|
||||
log.WithFields(log.Fields{
|
||||
|
Reference in New Issue
Block a user