File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 99 "encoding/base64"
1010 "encoding/hex"
1111 "encoding/json"
12+ "errors"
1213 "fmt"
1314 "io"
1415 "io/ioutil"
@@ -255,6 +256,7 @@ func ScheduleContainer(d conf.Docker, c *docker.Client) (err error) {
255256
256257 // do request for caporal
257258 log .Debug (string (payload ))
259+ log .Debug ("requesting caporal api: " , d .Caporal .Host + "/container" )
258260 req , err := http .NewRequest ("PUT" , d .Caporal .Host + "/container" , bytes .NewBuffer (payload ))
259261 authCode := base64 .StdEncoding .EncodeToString (Encrypt ([]byte (d .Auth .Username + ":" + d .Auth .Password ), "caoral-salt" ))
260262 log .WithFields (log.Fields {"CAPORAL" : "AUTH CODE" }).Debug (authCode )
@@ -273,6 +275,9 @@ func ScheduleContainer(d conf.Docker, c *docker.Client) (err error) {
273275 log .Debug (string (body ))
274276
275277 log .Debug (res .StatusCode )
278+ if res .StatusCode != 200 {
279+ return errors .New (string (body ))
280+ }
276281
277282 return
278283}
You can’t perform that action at this time.
0 commit comments