Browse code

more review updates

- return err instead of wrap for update secret
- add omitempty for data in secret spec

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

Evan Hazlett authored on 2016/11/09 01:34:45
Showing 5 changed files
... ...
@@ -327,7 +327,7 @@ func (sr *swarmRouter) updateSecret(ctx context.Context, w http.ResponseWriter,
327 327
 
328 328
 	id := vars["id"]
329 329
 	if err := sr.backend.UpdateSecret(id, version, secret); err != nil {
330
-		return errors.NewErrorWithStatusCode(err, http.StatusInternalServerError)
330
+		return err
331 331
 	}
332 332
 
333 333
 	return nil
... ...
@@ -14,7 +14,7 @@ type Secret struct {
14 14
 // SecretSpec represents a secret specification from a secret in swarm
15 15
 type SecretSpec struct {
16 16
 	Annotations
17
-	Data []byte
17
+	Data []byte `json:",omitempty"`
18 18
 }
19 19
 
20 20
 // SecretReferenceFileTarget is a file target in a secret reference
... ...
@@ -585,7 +585,6 @@ func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {
585 585
 	flags.BoolVar(&opts.healthcheck.noHealthcheck, flagNoHealthcheck, false, "Disable any container-specified HEALTHCHECK")
586 586
 
587 587
 	flags.BoolVarP(&opts.tty, flagTTY, "t", false, "Allocate a pseudo-TTY")
588
-	flags.StringSliceVar(&opts.secrets, flagSecret, []string{}, "Specify secrets to expose to the service")
589 588
 }
590 589
 
591 590
 const (
... ...
@@ -6,6 +6,7 @@ import (
6 6
 	"time"
7 7
 
8 8
 	"github.com/docker/docker/api/types/container"
9
+	"github.com/docker/docker/opts"
9 10
 	"github.com/docker/docker/pkg/testutil/assert"
10 11
 )
11 12
 
... ...
@@ -18,9 +18,9 @@ import (
18 18
 	"github.com/docker/docker/container"
19 19
 	"github.com/docker/docker/daemon/links"
20 20
 	"github.com/docker/docker/pkg/idtools"
21
+	"github.com/docker/docker/pkg/mount"
21 22
 	"github.com/docker/docker/pkg/stringid"
22 23
 	"github.com/docker/docker/runconfig"
23
-	"github.com/docker/engine-api/types/mount"
24 24
 	"github.com/docker/libnetwork"
25 25
 	"github.com/opencontainers/runc/libcontainer/configs"
26 26
 	"github.com/opencontainers/runc/libcontainer/devices"