Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
| ... | ... |
@@ -47,7 +47,7 @@ func runCreate(dockerCli *client.DockerCli, opts *serviceOptions) error {
|
| 47 | 47 |
} |
| 48 | 48 |
|
| 49 | 49 |
headers := map[string][]string{
|
| 50 |
- "x-registry-auth": {encodedAuth},
|
|
| 50 |
+ "X-Registry-Auth": {encodedAuth},
|
|
| 51 | 51 |
} |
| 52 | 52 |
|
| 53 | 53 |
response, err := apiClient.ServiceCreate(ctx, service, headers) |
| ... | ... |
@@ -76,9 +76,7 @@ func runServiceScale(dockerCli *client.DockerCli, serviceID string, scale string |
| 76 | 76 |
if err != nil {
|
| 77 | 77 |
return err |
| 78 | 78 |
} |
| 79 |
- headers = map[string][]string{
|
|
| 80 |
- "x-registry-auth": {encodedAuth},
|
|
| 81 |
- } |
|
| 79 |
+ headers["X-Registry-Auth"] = []string{encodedAuth}
|
|
| 82 | 80 |
} |
| 83 | 81 |
|
| 84 | 82 |
serviceMode := &service.Spec.Mode |
| ... | ... |
@@ -53,9 +53,7 @@ func runUpdate(dockerCli *client.DockerCli, flags *pflag.FlagSet, serviceID stri |
| 53 | 53 |
if err != nil {
|
| 54 | 54 |
return err |
| 55 | 55 |
} |
| 56 |
- headers = map[string][]string{
|
|
| 57 |
- "x-registry-auth": {encodedAuth},
|
|
| 58 |
- } |
|
| 56 |
+ headers["X-Registry-Auth"] = []string{encodedAuth}
|
|
| 59 | 57 |
} |
| 60 | 58 |
|
| 61 | 59 |
service, _, err := apiClient.ServiceInspectWithRaw(ctx, serviceID) |
| ... | ... |
@@ -184,18 +184,21 @@ func deployServices( |
| 184 | 184 |
if service, exists := existingServiceMap[name]; exists {
|
| 185 | 185 |
fmt.Fprintf(out, "Updating service %s (id: %s)\n", name, service.ID) |
| 186 | 186 |
|
| 187 |
+ // TODO(nishanttotla): Pass headers with X-Registry-Auth |
|
| 187 | 188 |
if err := apiClient.ServiceUpdate( |
| 188 | 189 |
ctx, |
| 189 | 190 |
service.ID, |
| 190 | 191 |
service.Version, |
| 191 | 192 |
serviceSpec, |
| 193 |
+ nil, |
|
| 192 | 194 |
); err != nil {
|
| 193 | 195 |
return err |
| 194 | 196 |
} |
| 195 | 197 |
} else {
|
| 196 | 198 |
fmt.Fprintf(out, "Creating service %s\n", name) |
| 197 | 199 |
|
| 198 |
- if _, err := apiClient.ServiceCreate(ctx, serviceSpec); err != nil {
|
|
| 200 |
+ // TODO(nishanttotla): Pass headers with X-Registry-Auth |
|
| 201 |
+ if _, err := apiClient.ServiceCreate(ctx, serviceSpec, nil); err != nil {
|
|
| 199 | 202 |
return err |
| 200 | 203 |
} |
| 201 | 204 |
} |
| ... | ... |
@@ -107,10 +107,7 @@ func (sr *swarmRouter) createService(ctx context.Context, w http.ResponseWriter, |
| 107 | 107 |
return err |
| 108 | 108 |
} |
| 109 | 109 |
|
| 110 |
- encodedAuth := "" |
|
| 111 |
- if auth, ok := r.Header["x-registry-auth"]; ok {
|
|
| 112 |
- encodedAuth = auth[0] |
|
| 113 |
- } |
|
| 110 |
+ encodedAuth := r.Header.Get("X-Registry-Auth")
|
|
| 114 | 111 |
|
| 115 | 112 |
id, err := sr.backend.CreateService(service, encodedAuth) |
| 116 | 113 |
if err != nil {
|
| ... | ... |
@@ -135,10 +132,7 @@ func (sr *swarmRouter) updateService(ctx context.Context, w http.ResponseWriter, |
| 135 | 135 |
return fmt.Errorf("Invalid service version '%s': %s", rawVersion, err.Error())
|
| 136 | 136 |
} |
| 137 | 137 |
|
| 138 |
- encodedAuth := "" |
|
| 139 |
- if auth, ok := r.Header["x-registry-auth"]; ok {
|
|
| 140 |
- encodedAuth = auth[0] |
|
| 141 |
- } |
|
| 138 |
+ encodedAuth := r.Header.Get("X-Registry-Auth")
|
|
| 142 | 139 |
|
| 143 | 140 |
if err := sr.backend.UpdateService(vars["id"], version, service, encodedAuth); err != nil {
|
| 144 | 141 |
logrus.Errorf("Error updating service %s: %v", vars["id"], err)
|
| ... | ... |
@@ -60,7 +60,7 @@ clone git golang.org/x/net 2beffdc2e92c8a3027590f898fe88f69af48a3f8 https://gith |
| 60 | 60 |
clone git golang.org/x/sys eb2c74142fd19a79b3f237334c7384d5167b1b46 https://github.com/golang/sys.git |
| 61 | 61 |
clone git github.com/docker/go-units 651fc226e7441360384da338d0fd37f2440ffbe3 |
| 62 | 62 |
clone git github.com/docker/go-connections fa2850ff103453a9ad190da0df0af134f0314b3d |
| 63 |
-clone git github.com/docker/engine-api c57d0447ea1ae71f6dad83c8d8a1215a89869a0c |
|
| 63 |
+clone git github.com/docker/engine-api 19b4fb48a86c3318e610e156ec06b684f79ac31d |
|
| 64 | 64 |
clone git github.com/RackSec/srslog 259aed10dfa74ea2961eddd1d9847619f6e98837 |
| 65 | 65 |
clone git github.com/imdario/mergo 0.2.1 |
| 66 | 66 |
|