mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Remove the redundant 'if' statements
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
This commit is contained in:
parent
173ce768d6
commit
98c0369437
1 changed files with 5 additions and 10 deletions
|
@ -101,10 +101,8 @@ func (c *Cluster) RemoveSecret(id string) error {
|
|||
SecretID: id,
|
||||
}
|
||||
|
||||
if _, err := state.controlClient.RemoveSecret(ctx, req); err != nil {
|
||||
_, err := state.controlClient.RemoveSecret(ctx, req)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// UpdateSecret updates a secret in a managed swarm cluster.
|
||||
|
@ -123,16 +121,13 @@ func (c *Cluster) UpdateSecret(id string, version uint64, spec types.SecretSpec)
|
|||
|
||||
secretSpec := convert.SecretSpecToGRPC(spec)
|
||||
|
||||
if _, err := state.controlClient.UpdateSecret(ctx,
|
||||
_, err := state.controlClient.UpdateSecret(ctx,
|
||||
&swarmapi.UpdateSecretRequest{
|
||||
SecretID: id,
|
||||
SecretVersion: &swarmapi.Version{
|
||||
Index: version,
|
||||
},
|
||||
Spec: &secretSpec,
|
||||
}); err != nil {
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue