Skip to content
This repository was archived by the owner on Jun 18, 2022. It is now read-only.

Commit 30e06ce

Browse files
Daishan PengDenise
Daishan Peng
authored and
Denise
committed
fix windows build
1 parent ecefa00 commit 30e06ce

File tree

4 files changed

+36
-35
lines changed

4 files changed

+36
-35
lines changed

core/compute/compute_windows.go

+4
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,7 @@ func dockerContainerCreate(ctx context.Context, dockerClient *client.Client, con
143143
})
144144
return ret, err
145145
}
146+
147+
func unmountRancherFlexVolume(instance model.Instance) error {
148+
return nil
149+
}

core/storage/plugin_unix.go

-33
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,6 @@ import (
1515
"github.com/rancher/agent/model"
1616
)
1717

18-
const (
19-
Create = "Create"
20-
Remove = "Remove"
21-
Attach = "Attach"
22-
Mount = "Mount"
23-
Path = "Path"
24-
Unmount = "Unmount"
25-
Get = "Get"
26-
List = "List"
27-
Capabilities = "Capabilities"
28-
)
29-
30-
// Response is the strucutre that the plugin's responses are serialized to.
31-
type Response struct {
32-
Mountpoint string
33-
Err string
34-
Volumes []*Volume
35-
Volume *Volume
36-
Capabilities Capability
37-
}
38-
39-
// Volume represents a volume object for use with `Get` and `List` requests
40-
type Volume struct {
41-
Name string
42-
Mountpoint string
43-
Status map[string]interface{}
44-
}
45-
46-
// Capability represents the list of capabilities a volume driver can return
47-
type Capability struct {
48-
Scope string
49-
}
50-
5118
func CallRancherStorageVolumePlugin(volume model.Volume, action string, payload interface{}) (Response, error) {
5219
transport := new(http.Transport)
5320
sockets.ConfigureTransport(transport, "unix", rancherStorageSockPath(volume))

core/storage/plugin_windows.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ import (
55
)
66

77
// callRancherStorageVolumeAttach is not supported on windows
8-
func callRancherStorageVolumeAttach(volume model.Volume) error {
9-
return nil
8+
func CallRancherStorageVolumePlugin(volume model.Volume, action string, payload interface{}) (Response, error) {
9+
return Response{}, nil
1010
}

core/storage/volume.go

+30
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,39 @@ import (
2121
)
2222

2323
const (
24+
Create = "Create"
25+
Remove = "Remove"
26+
Attach = "Attach"
27+
Mount = "Mount"
28+
Path = "Path"
29+
Unmount = "Unmount"
30+
Get = "Get"
31+
List = "List"
32+
Capabilities = "Capabilities"
2433
rancherSockDir = "/var/run/rancher/storage"
2534
)
2635

36+
// Response is the strucutre that the plugin's responses are serialized to.
37+
type Response struct {
38+
Mountpoint string
39+
Err string
40+
Volumes []*Volume
41+
Volume *Volume
42+
Capabilities Capability
43+
}
44+
45+
// Volume represents a volume object for use with `Get` and `List` requests
46+
type Volume struct {
47+
Name string
48+
Mountpoint string
49+
Status map[string]interface{}
50+
}
51+
52+
// Capability represents the list of capabilities a volume driver can return
53+
type Capability struct {
54+
Scope string
55+
}
56+
2757
var rancherDrivers = map[string]bool{
2858
"rancher-ebs": true,
2959
"rancher-nfs": true,

0 commit comments

Comments
 (0)