From 167efc72bb24d7ad2bcc91760a9a5d37572e104f Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Thu, 25 Feb 2016 16:02:33 -0800 Subject: [PATCH] Make email field omitempty for compatibility Newer instances of auth which do not include an email should not serialize the key, but existing values should not be stripped on serialization. Signed-off-by: Derek McGowan (github: dmcgowan) --- types/auth.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/types/auth.go b/types/auth.go index bd8374a9..13188775 100644 --- a/types/auth.go +++ b/types/auth.go @@ -2,9 +2,15 @@ package types // AuthConfig contains authorization information for connecting to a Registry type AuthConfig struct { - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty"` - Auth string `json:"auth,omitempty"` + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` + Auth string `json:"auth,omitempty"` + + // Email is an optional value associated with the username. + // This field is deprecated and will be removed in a later + // version of docker. + Email string `json:"email,omitempty"` + ServerAddress string `json:"serveraddress,omitempty"` RegistryToken string `json:"registrytoken,omitempty"` }