Merge pull request #757 from pszczekutowicz/master

Return errors from client in stack deploy configs
This commit is contained in:
Vincent Demeester 2017-12-19 11:05:49 +01:00 committed by GitHub
commit 2b8eb23b8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -248,13 +248,13 @@ func createConfigs(
case err == nil: case err == nil:
// config already exists, then we update that // config already exists, then we update that
if err := client.ConfigUpdate(ctx, config.ID, config.Meta.Version, configSpec); err != nil { if err := client.ConfigUpdate(ctx, config.ID, config.Meta.Version, configSpec); err != nil {
errors.Wrapf(err, "failed to update config %s", configSpec.Name) return errors.Wrapf(err, "failed to update config %s", configSpec.Name)
} }
case apiclient.IsErrNotFound(err): case apiclient.IsErrNotFound(err):
// config does not exist, then we create a new one. // config does not exist, then we create a new one.
fmt.Fprintf(dockerCli.Out(), "Creating config %s\n", configSpec.Name) fmt.Fprintf(dockerCli.Out(), "Creating config %s\n", configSpec.Name)
if _, err := client.ConfigCreate(ctx, configSpec); err != nil { if _, err := client.ConfigCreate(ctx, configSpec); err != nil {
errors.Wrapf(err, "failed to create config %s", configSpec.Name) return errors.Wrapf(err, "failed to create config %s", configSpec.Name)
} }
default: default:
return err return err