fix(): also drop api server response to debug in case there are no errors
All checks were successful
Gitea Docker Build Demo / Test (push) Successful in 1m0s
Gitea Docker Build Demo / Build_Image (push) Successful in 1m20s
Release / Test (release) Successful in 1m5s
Release / Build_Image (release) Successful in 1m19s

This commit is contained in:
2025-10-07 11:18:39 +02:00
parent d3682557b1
commit 4f81479069

View File

@@ -91,13 +91,18 @@ func RecreateIPPoolCrd(cfg *Config, name string, ips []string) error {
var status int
res.StatusCode(&status)
if status < 200 || status >= 400 {
return fmt.Errorf("failed to post CRD to kube api: %v", res.Error())
}
raw, rawErr := res.Raw()
if status < 200 || status >= 400 {
log.WithFields(log.Fields{
"Caller": "RecreateIPPoolCrd",
}).Infof("Response from k8s api server: %s", string(raw))
}).Warnf("Response from k8s api server: %s", string(raw))
return fmt.Errorf("failed to post CRD to kube api: %v", res.Error())
}
log.WithFields(log.Fields{
"Caller": "RecreateIPPoolCrd",
}).Debugf("Response from k8s api server: %s", string(raw))
if rawErr != nil {
log.WithFields(log.Fields{