diff --git a/registry/storage/driver/gcs/gcs.go b/registry/storage/driver/gcs/gcs.go index d1276c256..a1dbd1951 100644 --- a/registry/storage/driver/gcs/gcs.go +++ b/registry/storage/driver/gcs/gcs.go @@ -151,12 +151,16 @@ func FromParameters(parameters map[string]interface{}) (storagedriver.StorageDri for k, v := range credentialMap { key, ok := k.(string) if !ok { - return nil, fmt.Errorf("One of the credential keys was not a string") + return nil, fmt.Errorf("One of the credential keys was not a string: %s", fmt.Sprint(k)) } stringMap[key] = v } data, err := json.Marshal(stringMap) + if err != nil { + return nil, fmt.Errorf("Failed to marshal gcs credentials to json") + } + jwtConf, err := google.JWTConfigFromJSON(data, storage.ScopeFullControl) if err != nil { return nil, err