Merge pull request #29935 from yuexiao-wang/fix-return
Remove redundant return nil
This commit is contained in:
commit
1df474a311
1 changed files with 6 additions and 12 deletions
|
@ -1072,11 +1072,9 @@ func (c *Cluster) RemoveService(input string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if _, err := state.controlClient.RemoveService(ctx, &swarmapi.RemoveServiceRequest{ServiceID: service.ID}); err != nil {
|
||||
_, err = state.controlClient.RemoveService(ctx, &swarmapi.RemoveServiceRequest{ServiceID: service.ID})
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ServiceLogs collects service logs and writes them back to `config.OutStream`
|
||||
func (c *Cluster) ServiceLogs(ctx context.Context, input string, config *backend.ContainerLogsConfig, started chan struct{}) error {
|
||||
|
@ -1268,11 +1266,9 @@ func (c *Cluster) RemoveNode(input string, force bool) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if _, err := state.controlClient.RemoveNode(ctx, &swarmapi.RemoveNodeRequest{NodeID: node.ID, Force: force}); err != nil {
|
||||
_, err = state.controlClient.RemoveNode(ctx, &swarmapi.RemoveNodeRequest{NodeID: node.ID, Force: force})
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetTasks returns a list of tasks matching the filter options.
|
||||
func (c *Cluster) GetTasks(options apitypes.TaskListOptions) ([]types.Task, error) {
|
||||
|
@ -1594,11 +1590,9 @@ func (c *Cluster) RemoveNetwork(input string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if _, err := state.controlClient.RemoveNetwork(ctx, &swarmapi.RemoveNetworkRequest{NetworkID: network.ID}); err != nil {
|
||||
_, err = state.controlClient.RemoveNetwork(ctx, &swarmapi.RemoveNetworkRequest{NetworkID: network.ID})
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Cluster) populateNetworkID(ctx context.Context, client swarmapi.ControlClient, s *types.ServiceSpec) error {
|
||||
// Always prefer NetworkAttachmentConfigs from TaskTemplate
|
||||
|
|
Loading…
Reference in a new issue