Skip to content

Commit

Permalink
daemon/cluster: fix empty-lines (revive)
Browse files Browse the repository at this point in the history
    daemon/cluster/convert/service.go:96:34: empty-lines: extra empty line at the end of a block (revive)
    daemon/cluster/convert/service.go:169:44: empty-lines: extra empty line at the end of a block (revive)
    daemon/cluster/convert/service.go:470:30: empty-lines: extra empty line at the end of a block (revive)
    daemon/cluster/convert/container.go:224:23: empty-lines: extra empty line at the start of a block (revive)
    daemon/cluster/convert/network.go:109:14: empty-lines: extra empty line at the end of a block (revive)
    daemon/cluster/convert/service.go:537:27: empty-lines: extra empty line at the end of a block (revive)
    daemon/cluster/services.go:247:19: empty-lines: extra empty line at the end of a block (revive)
    daemon/cluster/services.go:252:41: empty-lines: extra empty line at the end of a block (revive)
    daemon/cluster/services.go:256:12: empty-lines: extra empty line at the end of a block (revive)
    daemon/cluster/services.go:289:80: empty-lines: extra empty line at the start of a block (revive)
    daemon/cluster/executor/container/health_test.go:18:37: empty-lines: extra empty line at the start of a block (revive)
    daemon/cluster/executor/container/adapter.go:437:68: empty-lines: extra empty line at the end of a block (revive)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Sep 27, 2022
1 parent 4eb9b5f commit 0c7b930
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 12 deletions.
1 change: 0 additions & 1 deletion daemon/cluster/convert/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ func configReferencesToGRPC(sr []*types.ConfigReference) ([]*swarmapi.ConfigRefe
func configReferencesFromGRPC(sr []*swarmapi.ConfigReference) []*types.ConfigReference {
refs := make([]*types.ConfigReference, 0, len(sr))
for _, s := range sr {

r := &types.ConfigReference{
ConfigID: s.ConfigID,
ConfigName: s.ConfigName,
Expand Down
1 change: 0 additions & 1 deletion daemon/cluster/convert/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ func endpointFromGRPC(e *swarmapi.Endpoint) types.Endpoint {
NetworkID: v.NetworkID,
Addr: v.Addr})
}

}

return endpoint
Expand Down
4 changes: 0 additions & 4 deletions daemon/cluster/convert/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ func serviceSpecFromGRPC(spec *swarmapi.ServiceSpec) (*types.ServiceSpec, error)
for _, n := range spec.Networks {
netConfig := types.NetworkAttachmentConfig{Target: n.Target, Aliases: n.Aliases, DriverOpts: n.DriverAttachmentOpts}
serviceNetworks = append(serviceNetworks, netConfig)

}

taskTemplate, err := taskSpecFromGRPC(spec.Task)
Expand Down Expand Up @@ -169,7 +168,6 @@ func ServiceSpecToGRPC(s types.ServiceSpec) (swarmapi.ServiceSpec, error) {
for _, n := range s.TaskTemplate.Networks {
netConfig := &swarmapi.NetworkAttachmentConfig{Target: n.Target, Aliases: n.Aliases, DriverAttachmentOpts: n.DriverOpts}
taskNetworks = append(taskNetworks, netConfig)

}

spec := swarmapi.ServiceSpec{
Expand Down Expand Up @@ -473,7 +471,6 @@ func resourcesToGRPC(res *types.ResourceRequirements) *swarmapi.ResourceRequirem
MemoryBytes: res.Reservations.MemoryBytes,
Generic: GenericResourcesToGRPC(res.Reservations.GenericResources),
}

}
}
return reqs
Expand Down Expand Up @@ -536,7 +533,6 @@ func restartPolicyToGRPC(p *types.RestartPolicy) (*swarmapi.RestartPolicy, error
}
if p.MaxAttempts != nil {
rp.MaxAttempts = *p.MaxAttempts

}
}
return rp, nil
Expand Down
1 change: 0 additions & 1 deletion daemon/cluster/executor/container/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@ func (c *containerAdapter) createVolumes(ctx context.Context) error {
// It returns an error if the driver name is different - that is a valid error
return err
}

}

return nil
Expand Down
1 change: 0 additions & 1 deletion daemon/cluster/executor/container/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
)

func TestHealthStates(t *testing.T) {

// set up environment: events, task, container ....
e := events.New()
_, l, _ := e.Subscribe()
Expand Down
4 changes: 0 additions & 4 deletions daemon/cluster/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,11 @@ func (c *Cluster) CreateService(s swarm.ServiceSpec, encodedAuth string, queryRe
logrus.Warnf("unable to pin image %s to digest: %s", ctnr.Image, err.Error())
// warning in the client response should be concise
resp.Warnings = append(resp.Warnings, digestWarning(ctnr.Image))

} else if ctnr.Image != digestImage {
logrus.Debugf("pinning image %s by digest: %s", ctnr.Image, digestImage)
ctnr.Image = digestImage

} else {
logrus.Debugf("creating service using supplied digest reference %s", ctnr.Image)

}

// Replace the context with a fresh one.
Expand Down Expand Up @@ -287,7 +284,6 @@ func (c *Cluster) UpdateService(serviceIDOrName string, version uint64, spec swa
var resp *types.ServiceUpdateResponse

err := c.lockedManagerAction(func(ctx context.Context, state nodeState) error {

err := c.populateNetworkID(ctx, state.controlClient, &spec)
if err != nil {
return err
Expand Down

0 comments on commit 0c7b930

Please sign in to comment.