Prevent accidentally shadowing these errors, which are used in defers.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -87,7 +87,7 @@ func (p *Controller) Update(ctx context.Context, t *api.Task) error {
|
| 87 | 87 |
} |
| 88 | 88 |
|
| 89 | 89 |
// Prepare is the prepare phase from swarmkit |
| 90 |
-func (p *Controller) Prepare(ctx context.Context) (err error) {
|
|
| 90 |
+func (p *Controller) Prepare(ctx context.Context) (retErr error) {
|
|
| 91 | 91 |
p.logger.Debug("Prepare")
|
| 92 | 92 |
|
| 93 | 93 |
remote, err := reference.ParseNormalizedNamed(p.spec.Remote) |
| ... | ... |
@@ -105,7 +105,7 @@ func (p *Controller) Prepare(ctx context.Context) (err error) {
|
| 105 | 105 |
pl, err := p.backend.Get(p.spec.Name) |
| 106 | 106 |
|
| 107 | 107 |
defer func() {
|
| 108 |
- if pl != nil && err == nil {
|
|
| 108 |
+ if pl != nil && retErr == nil {
|
|
| 109 | 109 |
pl.Acquire() |
| 110 | 110 |
} |
| 111 | 111 |
}() |