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

Commit

Permalink
fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
Daishan Peng authored and Denise committed Jan 12, 2018
1 parent ecefa00 commit 30e06ce
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 35 deletions.
4 changes: 4 additions & 0 deletions core/compute/compute_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,7 @@ func dockerContainerCreate(ctx context.Context, dockerClient *client.Client, con
})
return ret, err
}

func unmountRancherFlexVolume(instance model.Instance) error {
return nil
}
33 changes: 0 additions & 33 deletions core/storage/plugin_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,6 @@ import (
"github.com/rancher/agent/model"
)

const (
Create = "Create"
Remove = "Remove"
Attach = "Attach"
Mount = "Mount"
Path = "Path"
Unmount = "Unmount"
Get = "Get"
List = "List"
Capabilities = "Capabilities"
)

// Response is the strucutre that the plugin's responses are serialized to.
type Response struct {
Mountpoint string
Err string
Volumes []*Volume
Volume *Volume
Capabilities Capability
}

// Volume represents a volume object for use with `Get` and `List` requests
type Volume struct {
Name string
Mountpoint string
Status map[string]interface{}
}

// Capability represents the list of capabilities a volume driver can return
type Capability struct {
Scope string
}

func CallRancherStorageVolumePlugin(volume model.Volume, action string, payload interface{}) (Response, error) {
transport := new(http.Transport)
sockets.ConfigureTransport(transport, "unix", rancherStorageSockPath(volume))
Expand Down
4 changes: 2 additions & 2 deletions core/storage/plugin_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import (
)

// callRancherStorageVolumeAttach is not supported on windows
func callRancherStorageVolumeAttach(volume model.Volume) error {
return nil
func CallRancherStorageVolumePlugin(volume model.Volume, action string, payload interface{}) (Response, error) {
return Response{}, nil
}
30 changes: 30 additions & 0 deletions core/storage/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,39 @@ import (
)

const (
Create = "Create"
Remove = "Remove"
Attach = "Attach"
Mount = "Mount"
Path = "Path"
Unmount = "Unmount"
Get = "Get"
List = "List"
Capabilities = "Capabilities"
rancherSockDir = "/var/run/rancher/storage"
)

// Response is the strucutre that the plugin's responses are serialized to.
type Response struct {
Mountpoint string
Err string
Volumes []*Volume
Volume *Volume
Capabilities Capability
}

// Volume represents a volume object for use with `Get` and `List` requests
type Volume struct {
Name string
Mountpoint string
Status map[string]interface{}
}

// Capability represents the list of capabilities a volume driver can return
type Capability struct {
Scope string
}

var rancherDrivers = map[string]bool{
"rancher-ebs": true,
"rancher-nfs": true,
Expand Down

0 comments on commit 30e06ce

Please sign in to comment.