File tree 5 files changed +16
-72
lines changed
5 files changed +16
-72
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -18,24 +18,23 @@ package cleanup
18
18
19
19
import (
20
20
"fmt"
21
- "runtime"
22
21
23
22
"github.com/vishvananda/netlink"
24
23
)
25
24
26
- type bridge struct {}
25
+ func newBridgeStep () Step {
26
+ return linuxBridge {}
27
+ }
28
+
29
+ type linuxBridge struct {}
27
30
28
31
// Name returns the name of the step
29
- func (b * bridge ) Name () string {
32
+ func (linuxBridge ) Name () string {
30
33
return "kube-bridge leftovers cleanup step"
31
34
}
32
35
33
36
// Run removes found kube-bridge leftovers
34
- func (b * bridge ) Run () error {
35
- if runtime .GOOS == "windows" {
36
- return nil
37
- }
38
-
37
+ func (linuxBridge ) Run () error {
39
38
lnks , err := netlink .LinkList ()
40
39
if err != nil {
41
40
return fmt .Errorf ("failed to get link list from netlink: %w" , err )
Original file line number Diff line number Diff line change
1
+ //go:build !linux
2
+
1
3
/*
2
4
Copyright 2021 k0s authors
3
5
@@ -16,6 +18,6 @@ limitations under the License.
16
18
17
19
package cleanup
18
20
19
- // no need to build unix specific funcs into windows
20
- func cleanupMount ( path string ) {}
21
- func cleanupNetworkNamespace ( path string ) { }
21
+ func newBridgeStep () Step {
22
+ return nil
23
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -77,7 +77,10 @@ func (c *Config) Cleanup() error {
77
77
& services {Config : c },
78
78
& directories {Config : c },
79
79
& cni {},
80
- & bridge {},
80
+ }
81
+
82
+ if bridge := newBridgeStep (); bridge != nil {
83
+ cleanupSteps = append (cleanupSteps , bridge )
81
84
}
82
85
83
86
for _ , step := range cleanupSteps {
You can’t perform that action at this time.
0 commit comments