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>
Upstream-commit: 427c70d97779566b2b3ea3a9141bb9bf3dd05dd8
Component: engine
This commit is contained in:
Evan Hazlett
2016-11-09 14:27:45 -05:00
parent d5d838f9f3
commit bd20a72add
5 changed files with 4 additions and 4 deletions
@@ -327,7 +327,7 @@ func (sr *swarmRouter) updateSecret(ctx context.Context, w http.ResponseWriter,
id := vars["id"]
if err := sr.backend.UpdateSecret(id, version, secret); err != nil {
return errors.NewErrorWithStatusCode(err, http.StatusInternalServerError)
return err
}
return nil
+1 -1
View File
@@ -14,7 +14,7 @@ type Secret struct {
// SecretSpec represents a secret specification from a secret in swarm
type SecretSpec struct {
Annotations
Data []byte
Data []byte `json:",omitempty"`
}
// SecretReferenceFileTarget is a file target in a secret reference
@@ -585,7 +585,6 @@ func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {
flags.BoolVar(&opts.healthcheck.noHealthcheck, flagNoHealthcheck, false, "Disable any container-specified HEALTHCHECK")
flags.BoolVarP(&opts.tty, flagTTY, "t", false, "Allocate a pseudo-TTY")
flags.StringSliceVar(&opts.secrets, flagSecret, []string{}, "Specify secrets to expose to the service")
}
const (
@@ -6,6 +6,7 @@ import (
"time"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/opts"
"github.com/docker/docker/pkg/testutil/assert"
)
@@ -18,9 +18,9 @@ import (
"github.com/docker/docker/container"
"github.com/docker/docker/daemon/links"
"github.com/docker/docker/pkg/idtools"
"github.com/docker/docker/pkg/mount"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/runconfig"
"github.com/docker/engine-api/types/mount"
"github.com/docker/libnetwork"
"github.com/opencontainers/runc/libcontainer/configs"
"github.com/opencontainers/runc/libcontainer/devices"