Skip to content
Snippets Groups Projects
Commit e23ca5f6 authored by Andy Cobaugh's avatar Andy Cobaugh
Browse files

ci wait: move the body logging earlier so the bodies are always logged

parent b752f71d
No related branches found
No related tags found
No related merge requests found
Pipeline #227507 failed
......@@ -155,12 +155,14 @@ func runCiWaitCmd(cmd *cobra.Command, args []string) error {
defer resp.Body.Close()
if resp.StatusCode == http.StatusOK {
log.WithFields(log.Fields{"code": resp.StatusCode}).Info("Received response")
log.WithFields(log.Fields{"code": resp.StatusCode}).Info("Received OK response")
newBody, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.WithError(err).Error("Could not read body")
continue
}
log.Infof("Initial: %s", initialBody)
log.Infof("Current: %s", newBody)
if ciWaitVersionCompare(initialBody, newBody, newCommit, newVersion) {
log.Info("New version is live")
seen := 1
......@@ -194,10 +196,6 @@ func runCiWaitCmd(cmd *cobra.Command, args []string) error {
} else {
log.Warn("No update to version endpoint")
}
log.Infof("Initial: %s", initialBody)
log.Infof("Current: %s", newBody)
} else {
log.WithFields(log.Fields{"code": resp.StatusCode}).Warn("No OK response")
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment