Skip to content

[18.03] Fix linting issues#2700

Merged
cyli merged 1 commit into
moby:bump_v18.03from
thaJeztah:18.03-backport-linting-fixes
Jul 26, 2018
Merged

[18.03] Fix linting issues#2700
cyli merged 1 commit into
moby:bump_v18.03from
thaJeztah:18.03-backport-linting-fixes

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

cherry-pick of #2693 for 18.03 branch

cherry-pick was clean; no conflicts

Go 1.11 is stricter, and compilation will fail, revealing these issues;

agent/agent_test.go:120: *github.com/docker/swarmkit/api.WeightedPeer composite literal uses unkeyed fields
agent/agent_test.go:125: *github.com/docker/swarmkit/api.WeightedPeer composite literal uses unkeyed fields
agent/agent_test.go:130: *github.com/docker/swarmkit/api.WeightedPeer composite literal uses unkeyed fields
agent/agent_test.go:135: *github.com/docker/swarmkit/api.WeightedPeer composite literal uses unkeyed fields
agent/agent_test.go:140: *github.com/docker/swarmkit/api.WeightedPeer composite literal uses unkeyed fields
manager/dispatcher/dispatcher.go:426: Entry.Info call has possible formatting directive %s
manager/dispatcher/dispatcher.go:547: Entry.Debug call has possible formatting directive %s
make: *** [vet] Error 1

Signed-off-by: Sebastiaan van Stijn github@gone.nl
(cherry picked from commit 59064c3)
Signed-off-by: Sebastiaan van Stijn github@gone.nl

- What I did

- How I did it

- How to test it

- Description for the changelog

@dperny
Copy link
Copy Markdown
Collaborator

dperny commented Jul 9, 2018

LGTM

@thaJeztah
Copy link
Copy Markdown
Member Author

Boo!

ok  	github.com/docker/swarmkit/manager	6.710s	coverage: 81.7% of statements
time="2018-07-09T23:03:36Z" level=error msg="task allocation failure" error="failed to retrieve network testID3 while allocating task testTaskID3" 
time="2018-07-09T23:03:36Z" level=error msg="Failed allocation for network testID5" error="failed while allocating driver state for network testID5: could not obtain vxlan id for pool 10.0.4.0/24: requested bit is already allocated" 
time="2018-07-09T23:03:36Z" level=error msg="task allocation failure" error="network testID5 attached to task testTaskID6 not allocated yet" 
time="2018-07-09T23:03:36Z" level=error msg="Failed allocation for service testServiceID4" error="requested bit is already allocated" 
time="2018-07-09T23:03:36Z" level=error msg="task allocation failure" error="service testServiceID4 to which task testTaskID7 belongs has pending allocations" 
--- FAIL: TestNodeAllocator (0.04s)
	allocator_test.go:1434: timed out before watchNode found expected node state
FAIL

@thaJeztah
Copy link
Copy Markdown
Member Author

Tried to force push to trigger CI, and got the same failure, however, doing a "dummy" PR against the 18.03 branch doesn't show that failure; #2701

Is something flaky in this test, or can it be triggered somehow by the changes here?

Go 1.11 is stricter, and compilation will fail, revealing these issues;

```
agent/agent_test.go:120: *github.com/docker/swarmkit/api.WeightedPeer composite literal uses unkeyed fields
agent/agent_test.go:125: *github.com/docker/swarmkit/api.WeightedPeer composite literal uses unkeyed fields
agent/agent_test.go:130: *github.com/docker/swarmkit/api.WeightedPeer composite literal uses unkeyed fields
agent/agent_test.go:135: *github.com/docker/swarmkit/api.WeightedPeer composite literal uses unkeyed fields
agent/agent_test.go:140: *github.com/docker/swarmkit/api.WeightedPeer composite literal uses unkeyed fields
manager/dispatcher/dispatcher.go:426: Entry.Info call has possible formatting directive %s
manager/dispatcher/dispatcher.go:547: Entry.Debug call has possible formatting directive %s
make: *** [vet] Error 1
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 59064c3)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the 18.03-backport-linting-fixes branch from aad90d6 to ee05652 Compare July 12, 2018 10:56
Copy link
Copy Markdown
Contributor

@cyli cyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks @thaJeztah - TestNodeAllocator is known flakey.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 26, 2018

Codecov Report

Merging #2700 into bump_v18.03 will decrease coverage by 0.32%.
The diff coverage is 50%.

@@               Coverage Diff               @@
##           bump_v18.03    #2700      +/-   ##
===============================================
- Coverage        61.82%   61.49%   -0.33%     
===============================================
  Files              134      134              
  Lines            21820    21820              
===============================================
- Hits             13491    13419      -72     
- Misses            6888     6948      +60     
- Partials          1441     1453      +12

@cyli cyli merged commit 241d71f into moby:bump_v18.03 Jul 26, 2018
@thaJeztah thaJeztah deleted the 18.03-backport-linting-fixes branch July 26, 2018 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants