Remove unused code

This commit is contained in:
Marcos Lilljedahl
2018-02-26 21:39:57 -03:00
parent 79c778a2bf
commit b8918c6510
2 changed files with 1 additions and 11 deletions

View File

@@ -8,7 +8,6 @@ import (
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/play-with-docker/play-with-docker/provisioner" "github.com/play-with-docker/play-with-docker/provisioner"
"github.com/play-with-docker/play-with-docker/pwd"
"github.com/play-with-docker/play-with-docker/pwd/types" "github.com/play-with-docker/play-with-docker/pwd/types"
) )
@@ -54,10 +53,7 @@ func NewInstance(rw http.ResponseWriter, req *http.Request) {
i, err := core.InstanceNew(s, body) i, err := core.InstanceNew(s, body)
if err != nil { if err != nil {
if pwd.SessionComplete(err) { if provisioner.OutOfCapacity(err) {
rw.WriteHeader(http.StatusConflict)
return
} else if provisioner.OutOfCapacity(err) {
rw.WriteHeader(http.StatusServiceUnavailable) rw.WriteHeader(http.StatusServiceUnavailable)
fmt.Fprintln(rw, `{"error": "out_of_capacity"}`) fmt.Fprintln(rw, `{"error": "out_of_capacity"}`)
return return

View File

@@ -60,12 +60,6 @@ type pwd struct {
dindProvisioner provisioner.InstanceProvisionerApi dindProvisioner provisioner.InstanceProvisionerApi
} }
var sessionComplete = errors.New("Session is complete")
func SessionComplete(e error) bool {
return e == sessionComplete
}
var sessionNotEmpty = errors.New("Session is not empty") var sessionNotEmpty = errors.New("Session is not empty")
func SessionNotEmpty(e error) bool { func SessionNotEmpty(e error) bool {