libnetwork: use plugin Content-Type headers v1.2
The MediaType was changed twice in; -b3b7eb2723
("application/vnd.docker.plugins.v1+json" -> "application/vnd.docker.plugins.v1.1+json") -54587d861d
("application/vnd.docker.plugins.v1.1+json" -> "application/vnd.docker.plugins.v1.2+json") But the (integration) tests were still using the old version, so let's use the VersionMimeType const that's defined, and use the updated version. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
93b5c31541
commit
481dde8b70
4 changed files with 8 additions and 8 deletions
|
@ -126,7 +126,7 @@ func setupPlugin(t *testing.T, ec map[string]*graphEventsCounter, ext string, mu
|
|||
}
|
||||
|
||||
respond := func(w http.ResponseWriter, data interface{}) {
|
||||
w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
|
||||
w.Header().Set("Content-Type", plugins.VersionMimetype)
|
||||
switch t := data.(type) {
|
||||
case error:
|
||||
fmt.Fprintf(w, "{\"Err\": %q}\n", t.Error())
|
||||
|
|
|
@ -66,7 +66,7 @@ func setupPlugin(t *testing.T, name string, mux *http.ServeMux) func() {
|
|||
}
|
||||
|
||||
mux.HandleFunc("/Plugin.Activate", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
|
||||
w.Header().Set("Content-Type", plugins.VersionMimetype)
|
||||
fmt.Fprintf(w, `{"Implements": ["%s"]}`, driverapi.NetworkPluginEndpointType)
|
||||
})
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ func setupPlugin(t *testing.T, name string, mux *http.ServeMux) func() {
|
|||
}
|
||||
|
||||
mux.HandleFunc("/Plugin.Activate", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
|
||||
w.Header().Set("Content-Type", plugins.VersionMimetype)
|
||||
fmt.Fprintf(w, `{"Implements": ["%s"]}`, ipamapi.PluginEndpointType)
|
||||
})
|
||||
|
||||
|
|
|
@ -1164,7 +1164,7 @@ func TestInvalidRemoteDriver(t *testing.T) {
|
|||
defer server.Close()
|
||||
|
||||
mux.HandleFunc("/Plugin.Activate", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
|
||||
w.Header().Set("Content-Type", plugins.VersionMimetype)
|
||||
fmt.Fprintln(w, `{"Implements": ["InvalidDriver"]}`)
|
||||
})
|
||||
|
||||
|
@ -1207,19 +1207,19 @@ func TestValidRemoteDriver(t *testing.T) {
|
|||
defer server.Close()
|
||||
|
||||
mux.HandleFunc("/Plugin.Activate", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
|
||||
w.Header().Set("Content-Type", plugins.VersionMimetype)
|
||||
fmt.Fprintf(w, `{"Implements": ["%s"]}`, driverapi.NetworkPluginEndpointType)
|
||||
})
|
||||
mux.HandleFunc(fmt.Sprintf("/%s.GetCapabilities", driverapi.NetworkPluginEndpointType), func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
|
||||
w.Header().Set("Content-Type", plugins.VersionMimetype)
|
||||
fmt.Fprintf(w, `{"Scope":"local"}`)
|
||||
})
|
||||
mux.HandleFunc(fmt.Sprintf("/%s.CreateNetwork", driverapi.NetworkPluginEndpointType), func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
|
||||
w.Header().Set("Content-Type", plugins.VersionMimetype)
|
||||
fmt.Fprintf(w, "null")
|
||||
})
|
||||
mux.HandleFunc(fmt.Sprintf("/%s.DeleteNetwork", driverapi.NetworkPluginEndpointType), func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json")
|
||||
w.Header().Set("Content-Type", plugins.VersionMimetype)
|
||||
fmt.Fprintf(w, "null")
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue