From ac615c51ba155674490467f86219230f6a373c95 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Mon, 7 Mar 2016 21:41:44 -0500 Subject: [PATCH] When calling volume driver Mount, send opaque ID This generates an ID string for calls to Mount/Unmount, allowing drivers to differentiate between two callers of `Mount` and `Unmount`. Signed-off-by: Brian Goff --- plugins/pluginrpc-gen/template.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/pluginrpc-gen/template.go b/plugins/pluginrpc-gen/template.go index 704030c..d3dc494 100644 --- a/plugins/pluginrpc-gen/template.go +++ b/plugins/pluginrpc-gen/template.go @@ -42,10 +42,17 @@ var templFuncs = template.FuncMap{ "marshalType": marshalType, "isErr": isErr, "lower": strings.ToLower, - "title": strings.Title, + "title": title, "tag": buildTag, } +func title(s string) string { + if strings.ToLower(s) == "id" { + return "ID" + } + return strings.Title(s) +} + var generatedTempl = template.Must(template.New("rpc_cient").Funcs(templFuncs).Parse(` // generated code - DO NOT EDIT {{ range $k, $v := .BuildTags }}