@@ -14,7 +14,7 @@ const (
1414 // DefaultDockerRootDirectory is the default directory where volumes will be created.
1515 DefaultDockerRootDirectory = "/var/lib/docker/volumes"
1616
17- defaultContentTypeV1 = "application/vnd.docker.plugins.v1+json"
17+ defaultContentTypeV1_1 = "application/vnd.docker.plugins.v1.1 +json"
1818 defaultImplementationManifest = `{"Implements": ["VolumeDriver"]}`
1919 pluginSpecDir = "/etc/docker/plugins"
2020 pluginSockDir = "/run/docker/plugins"
@@ -29,7 +29,8 @@ const (
2929
3030// Request is the structure that docker's requests are deserialized to.
3131type Request struct {
32- Name string
32+ Name string
33+ Options map [string ]string `json:"Opts,omitempty"`
3334}
3435
3536// Response is the strucutre that the plugin's responses are serialized to.
@@ -64,7 +65,7 @@ func NewHandler(driver Driver) *Handler {
6465
6566func (h * Handler ) initMux () {
6667 h .mux .HandleFunc (activatePath , func (w http.ResponseWriter , r * http.Request ) {
67- w .Header ().Set ("Content-Type" , defaultContentTypeV1 )
68+ w .Header ().Set ("Content-Type" , defaultContentTypeV1_1 )
6869 fmt .Fprintln (w , defaultImplementationManifest )
6970 })
7071
@@ -153,7 +154,7 @@ func decodeRequest(w http.ResponseWriter, r *http.Request) (req Request, err err
153154}
154155
155156func encodeResponse (w http.ResponseWriter , res Response ) {
156- w .Header ().Set ("Content-Type" , defaultContentTypeV1 )
157+ w .Header ().Set ("Content-Type" , defaultContentTypeV1_1 )
157158 if res .Err != "" {
158159 w .WriteHeader (http .StatusInternalServerError )
159160 }
0 commit comments