From 98506c961b9e0d155c1e0d124bb95d72cbb1d8c3 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Wed, 27 Oct 2021 11:42:25 -0700 Subject: Allow label and labels when creating volumes JSON payload may have either key. Labels will override any values set via Label. Fixes #12102 Signed-off-by: Jhon Honce --- pkg/domain/entities/volumes.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pkg/domain/entities') diff --git a/pkg/domain/entities/volumes.go b/pkg/domain/entities/volumes.go index 2ecfb4446..9b2a170e2 100644 --- a/pkg/domain/entities/volumes.go +++ b/pkg/domain/entities/volumes.go @@ -78,8 +78,10 @@ type VolumeCreateOptions struct { Name string `schema:"name"` // Volume driver to use Driver string `schema:"driver"` - // User-defined key/value metadata. + // User-defined key/value metadata. Provided for compatibility Label map[string]string `schema:"label"` + // User-defined key/value metadata. Preferred field, will override Label + Labels map[string]string `schema:"labels"` // Mapping of driver options and values. Options map[string]string `schema:"opts"` } -- cgit v1.2.3-54-g00ecf