Remove unused code
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user