Merge pull request #1103 from arobson/docker-api-version

Change docker version to v1.19 from invalid v1.9
This commit is contained in:
Brad Rydzewski 2015-07-20 09:17:15 -07:00
commit 972654e863
2 changed files with 29 additions and 29 deletions

View file

@ -55,14 +55,14 @@ func TestSetup(t *testing.T) {
// Handles a request to inspect the Go 1.2 image // Handles a request to inspect the Go 1.2 image
// This will return a dummy image ID, so that the system knows // This will return a dummy image ID, so that the system knows
// the build image exists, and doens't need to be downloaded. // the build image exists, and doens't need to be downloaded.
mux.HandleFunc("/v1.9/images/bradrydzewski/go:1.2/json", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/images/bradrydzewski/go:1.2/json", func(w http.ResponseWriter, r *http.Request) {
body := `[{ "id": "7bf9ce0ffb7236ca68da0f9fed0e1682053b393db3c724ff3c5a4e8c0793b34c" }]` body := `[{ "id": "7bf9ce0ffb7236ca68da0f9fed0e1682053b393db3c724ff3c5a4e8c0793b34c" }]`
w.Write([]byte(body)) w.Write([]byte(body))
}) })
// Handles a request to create the build image, with the build // Handles a request to create the build image, with the build
// script injected. This will return a dummy stream. // script injected. This will return a dummy stream.
mux.HandleFunc("/v1.9/build", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/build", func(w http.ResponseWriter, r *http.Request) {
body := `{"stream":"Step 1..."}` body := `{"stream":"Step 1..."}`
w.Write([]byte(body)) w.Write([]byte(body))
}) })
@ -71,7 +71,7 @@ func TestSetup(t *testing.T) {
// that we are doing a "wildcard" url match here, since the name of // that we are doing a "wildcard" url match here, since the name of
// the image will be random. This will return a dummy image ID // the image will be random. This will return a dummy image ID
// to confirm the build image was created successfully. // to confirm the build image was created successfully.
mux.HandleFunc("/v1.9/images/", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/images/", func(w http.ResponseWriter, r *http.Request) {
body := `{ "id": "7bf9ce0ffb7236ca68da0f9fed0e1682053b393db3c724ff3c5a4e8c0793b34c" }` body := `{ "id": "7bf9ce0ffb7236ca68da0f9fed0e1682053b393db3c724ff3c5a4e8c0793b34c" }`
w.Write([]byte(body)) w.Write([]byte(body))
}) })
@ -122,7 +122,7 @@ func TestSetupErrorPullImage(t *testing.T) {
setup() setup()
defer teardown() defer teardown()
mux.HandleFunc("/v1.9/images/bradrydzewski/mysql:5.5/json", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/images/bradrydzewski/mysql:5.5/json", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound) w.WriteHeader(http.StatusNotFound)
}) })
@ -134,12 +134,12 @@ func TestSetupErrorRunDaemonPorts(t *testing.T) {
setup() setup()
defer teardown() defer teardown()
mux.HandleFunc("/v1.9/images/bradrydzewski/mysql:5.5/json", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/images/bradrydzewski/mysql:5.5/json", func(w http.ResponseWriter, r *http.Request) {
data := []byte(`{"config": { "ExposedPorts": { "6379/tcp": {}}}}`) data := []byte(`{"config": { "ExposedPorts": { "6379/tcp": {}}}}`)
w.Write(data) w.Write(data)
}) })
mux.HandleFunc("/v1.9/containers/create", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/containers/create", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusBadRequest) w.WriteHeader(http.StatusBadRequest)
}) })
@ -164,21 +164,21 @@ func TestSetupErrorServiceInspect(t *testing.T) {
setup() setup()
defer teardown() defer teardown()
mux.HandleFunc("/v1.9/images/bradrydzewski/mysql:5.5/json", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/images/bradrydzewski/mysql:5.5/json", func(w http.ResponseWriter, r *http.Request) {
data := []byte(`{"config": { "ExposedPorts": { "6379/tcp": {}}}}`) data := []byte(`{"config": { "ExposedPorts": { "6379/tcp": {}}}}`)
w.Write(data) w.Write(data)
}) })
mux.HandleFunc("/v1.9/containers/create", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/containers/create", func(w http.ResponseWriter, r *http.Request) {
body := `{ "Id":"e90e34656806", "Warnings":[] }` body := `{ "Id":"e90e34656806", "Warnings":[] }`
w.Write([]byte(body)) w.Write([]byte(body))
}) })
mux.HandleFunc("/v1.9/containers/e90e34656806/start", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/containers/e90e34656806/start", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNoContent) w.WriteHeader(http.StatusNoContent)
}) })
mux.HandleFunc("/v1.9/containers/e90e34656806/json", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/containers/e90e34656806/json", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusBadRequest) w.WriteHeader(http.StatusBadRequest)
}) })
@ -202,11 +202,11 @@ func TestSetupErrorImagePull(t *testing.T) {
setup() setup()
defer teardown() defer teardown()
mux.HandleFunc("/v1.9/images/bradrydzewski/mysql:5.5/json", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/images/bradrydzewski/mysql:5.5/json", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound) w.WriteHeader(http.StatusNotFound)
}) })
mux.HandleFunc("/v1.9/images/create?fromImage=bradrydzewski/mysql&tag=5.5", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/images/create?fromImage=bradrydzewski/mysql&tag=5.5", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusBadRequest) w.WriteHeader(http.StatusBadRequest)
}) })
@ -230,7 +230,7 @@ func TestSetupErrorUpdate(t *testing.T) {
setup() setup()
defer teardown() defer teardown()
mux.HandleFunc("/v1.9/images/create", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/images/create", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusBadRequest) w.WriteHeader(http.StatusBadRequest)
}) })
@ -254,12 +254,12 @@ func TestSetupErrorBuild(t *testing.T) {
setup() setup()
defer teardown() defer teardown()
mux.HandleFunc("/v1.9/images/bradrydzewski/go:1.2/json", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/images/bradrydzewski/go:1.2/json", func(w http.ResponseWriter, r *http.Request) {
body := `[{ "id": "7bf9ce0ffb7236ca68da0f9fed0e1682053b393db3c724ff3c5a4e8c0793b34c" }]` body := `[{ "id": "7bf9ce0ffb7236ca68da0f9fed0e1682053b393db3c724ff3c5a4e8c0793b34c" }]`
w.Write([]byte(body)) w.Write([]byte(body))
}) })
mux.HandleFunc("/v1.9/build", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/build", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusBadRequest) w.WriteHeader(http.StatusBadRequest)
}) })
@ -284,17 +284,17 @@ func TestSetupErrorBuildInspect(t *testing.T) {
setup() setup()
defer teardown() defer teardown()
mux.HandleFunc("/v1.9/images/bradrydzewski/go:1.2/json", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/images/bradrydzewski/go:1.2/json", func(w http.ResponseWriter, r *http.Request) {
body := `[{ "id": "7bf9ce0ffb7236ca68da0f9fed0e1682053b393db3c724ff3c5a4e8c0793b34c" }]` body := `[{ "id": "7bf9ce0ffb7236ca68da0f9fed0e1682053b393db3c724ff3c5a4e8c0793b34c" }]`
w.Write([]byte(body)) w.Write([]byte(body))
}) })
mux.HandleFunc("/v1.9/build", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/build", func(w http.ResponseWriter, r *http.Request) {
body := `{"stream":"Step 1..."}` body := `{"stream":"Step 1..."}`
w.Write([]byte(body)) w.Write([]byte(body))
}) })
mux.HandleFunc("/v1.9/images/", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/images/", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusBadRequest) w.WriteHeader(http.StatusBadRequest)
}) })
@ -325,27 +325,27 @@ func TestTeardown(t *testing.T) {
imageRemoved = false imageRemoved = false
) )
mux.HandleFunc("/v1.9/containers/7bf9ce0ffb/stop", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/containers/7bf9ce0ffb/stop", func(w http.ResponseWriter, r *http.Request) {
containerStopped = true containerStopped = true
w.WriteHeader(http.StatusOK) w.WriteHeader(http.StatusOK)
}) })
mux.HandleFunc("/v1.9/containers/7bf9ce0ffb", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/containers/7bf9ce0ffb", func(w http.ResponseWriter, r *http.Request) {
containerRemoved = true containerRemoved = true
w.WriteHeader(http.StatusOK) w.WriteHeader(http.StatusOK)
}) })
mux.HandleFunc("/v1.9/containers/ec62dcc736/stop", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/containers/ec62dcc736/stop", func(w http.ResponseWriter, r *http.Request) {
serviceStopped = true serviceStopped = true
w.WriteHeader(http.StatusOK) w.WriteHeader(http.StatusOK)
}) })
mux.HandleFunc("/v1.9/containers/ec62dcc736", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/containers/ec62dcc736", func(w http.ResponseWriter, r *http.Request) {
serviceRemoved = true serviceRemoved = true
w.WriteHeader(http.StatusOK) w.WriteHeader(http.StatusOK)
}) })
mux.HandleFunc("/v1.9/images/c3ab8ff137", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/images/c3ab8ff137", func(w http.ResponseWriter, r *http.Request) {
imageRemoved = true imageRemoved = true
w.Write([]byte(`[{"Untagged":"c3ab8ff137"},{"Deleted":"c3ab8ff137"}]`)) w.Write([]byte(`[{"Untagged":"c3ab8ff137"},{"Deleted":"c3ab8ff137"}]`))
}) })
@ -389,12 +389,12 @@ func TestRunPrivileged(t *testing.T) {
var conf = docker.HostConfig{} var conf = docker.HostConfig{}
mux.HandleFunc("/v1.9/containers/create", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/containers/create", func(w http.ResponseWriter, r *http.Request) {
body := `{ "Id":"e90e34656806", "Warnings":[] }` body := `{ "Id":"e90e34656806", "Warnings":[] }`
w.Write([]byte(body)) w.Write([]byte(body))
}) })
mux.HandleFunc("/v1.9/containers/e90e34656806/start", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/containers/e90e34656806/start", func(w http.ResponseWriter, r *http.Request) {
json.NewDecoder(r.Body).Decode(&conf) json.NewDecoder(r.Body).Decode(&conf)
w.WriteHeader(http.StatusBadRequest) w.WriteHeader(http.StatusBadRequest)
}) })
@ -452,7 +452,7 @@ func TestRunErrorCreate(t *testing.T) {
setup() setup()
defer teardown() defer teardown()
mux.HandleFunc("/v1.9/containers/create", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/containers/create", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusBadRequest) w.WriteHeader(http.StatusBadRequest)
}) })
@ -477,13 +477,13 @@ func TestRunErrorStart(t *testing.T) {
containerStarted = false containerStarted = false
) )
mux.HandleFunc("/v1.9/containers/create", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/containers/create", func(w http.ResponseWriter, r *http.Request) {
containerCreated = true containerCreated = true
body := `{ "Id":"e90e34656806", "Warnings":[] }` body := `{ "Id":"e90e34656806", "Warnings":[] }`
w.Write([]byte(body)) w.Write([]byte(body))
}) })
mux.HandleFunc("/v1.9/containers/e90e34656806/start", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/v1.12/containers/e90e34656806/start", func(w http.ResponseWriter, r *http.Request) {
containerStarted = true containerStarted = true
w.WriteHeader(http.StatusBadRequest) w.WriteHeader(http.StatusBadRequest)
}) })

View file

@ -21,7 +21,7 @@ import (
) )
const ( const (
APIVERSION = 1.9 APIVERSION = 1.12
DEFAULTHTTPPORT = 2375 DEFAULTHTTPPORT = 2375
DEFAULTUNIXSOCKET = "/var/run/docker.sock" DEFAULTUNIXSOCKET = "/var/run/docker.sock"
DEFAULTPROTOCOL = "unix" DEFAULTPROTOCOL = "unix"