[botanist][health_checker] Check body of response from amt reboot to see if it
actually worked or not.
Currently in the health_checker, we just think it works if the http POST
doesn't return an error, but we need to check the body of the response to see
if we get a return value of 0. The other return value we've seen is 2, which is
an error.
Change-Id: I1efb126f23cf21080065766b3e6dfb60ccb3b691
diff --git a/botanist/power/amt/amt.go b/botanist/power/amt/amt.go
index 9a4542a..2146cbc 100644
--- a/botanist/power/amt/amt.go
+++ b/botanist/power/amt/amt.go
@@ -6,6 +6,7 @@
import (
"fmt"
+ "io/ioutil"
"net/http"
"net/url"
"strings"
@@ -84,5 +85,14 @@
}
defer res.Body.Close()
+ body, err := ioutil.ReadAll(res.Body)
+ if err != nil {
+ return err
+ }
+ returnValue := string(strings.Split(string(body), "ReturnValue>")[1][0])
+ if returnValue != "0" {
+ return fmt.Errorf("amt reboot ReturnValue=%s", returnValue)
+ }
+
return nil
}