Ejemplo n.º 1
0
func bsUpgradeHandler(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	err := bs.SaveImage("")
	if err != nil {
		return err
	}
	err = bs.RecreateContainers(mainDockerProvisioner)
	if err != nil {
		return err
	}
	w.WriteHeader(http.StatusNoContent)
	return nil
}
Ejemplo n.º 2
0
func bsUpgradeHandler(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	err := bs.SaveImage("")
	if err != nil {
		return err
	}
	keepAliveWriter := tsuruIo.NewKeepAliveWriter(w, 15*time.Second, "")
	defer keepAliveWriter.Stop()
	writer := &tsuruIo.SimpleJsonMessageEncoderWriter{Encoder: json.NewEncoder(keepAliveWriter)}
	err = bs.RecreateContainers(mainDockerProvisioner, writer)
	if err != nil {
		writer.Encode(tsuruIo.SimpleJsonMessage{Error: err.Error()})
	}
	return nil
}