Skip to content

Commit 2aace36

Browse files
Merge pull request #247 from jhowardmsft/jjh/lock
Store fixes; Windows compile
2 parents 009ebee + a386846 commit 2aace36

File tree

16 files changed

+48
-43
lines changed

16 files changed

+48
-43
lines changed

cni/plugin.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,14 @@ func (plugin *Plugin) InitializeKeyValueStore(config *common.PluginConfig) error
161161
var err error
162162
plugin.Store, err = store.NewJsonFileStore(platform.CNIRuntimePath + plugin.Name + ".json")
163163
if err != nil {
164-
log.Printf("[cni] Failed to create store, err:%v.", err)
164+
log.Printf("[cni] Failed to create store: %v.", err)
165165
return err
166166
}
167167
}
168168

169169
// Acquire store lock.
170170
if err := plugin.Store.Lock(true); err != nil {
171-
log.Printf("[cni] Timed out on locking store, err:%v.", err)
171+
log.Printf("[cni] Failed to lock store: %v.", err)
172172
return err
173173
}
174174

@@ -182,7 +182,7 @@ func (plugin *Plugin) UninitializeKeyValueStore() error {
182182
if plugin.Store != nil {
183183
err := plugin.Store.Unlock()
184184
if err != nil {
185-
log.Printf("[cni] Failed to unlock store, err:%v.", err)
185+
log.Printf("[cni] Failed to unlock store: %v.", err)
186186
return err
187187
}
188188
}

netlink/ip.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright 2017 Microsoft. All rights reserved.
22
// MIT License
33

4+
// +build linux
5+
46
package netlink
57

68
import (

netlink/link.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright 2017 Microsoft. All rights reserved.
22
// MIT License
33

4+
// +build linux
5+
46
package netlink
57

68
import (

netlink/netlink.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright 2017 Microsoft. All rights reserved.
22
// MIT License
33

4+
// +build linux
5+
46
package netlink
57

68
import (

netlink/netlink_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright 2017 Microsoft. All rights reserved.
22
// MIT License
33

4+
// +build linux
5+
46
package netlink
57

68
import (

netlink/netlink_windows.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Copyright 2017 Microsoft. All rights reserved.
2+
// MIT License
3+
4+
package netlink

netlink/protocol.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright 2017 Microsoft. All rights reserved.
22
// MIT License
33

4+
// +build linux
5+
46
package netlink
57

68
import (

netlink/socket.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright 2017 Microsoft. All rights reserved.
22
// MIT License
33

4+
// +build linux
5+
46
package netlink
57

68
import (

network/endpoint_linux.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright 2017 Microsoft. All rights reserved.
22
// MIT License
33

4-
// +build linux
5-
64
package network
75

86
import (

network/endpoint_windows.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright 2017 Microsoft. All rights reserved.
22
// MIT License
33

4-
// +build windows
5-
64
package network
75

86
import (

0 commit comments

Comments
 (0)