Remove the redundant 'if' statements
@@ -101,11 +101,9 @@ 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.
// Note: this is not exposed to the CLI but is available from the API only
@@ -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
-}
