mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
csi: Expose grpc.CallOptions for NodeStageVolume
This commit is contained in:
committed by
Tim Gross
parent
6b28db98b6
commit
7dc0431cb8
@@ -299,7 +299,7 @@ func (c *client) NodeGetInfo(ctx context.Context) (*NodeGetInfoResponse, error)
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (c *client) NodeStageVolume(ctx context.Context, volumeID string, publishContext map[string]string, stagingTargetPath string, capabilities *VolumeCapability) error {
|
||||
func (c *client) NodeStageVolume(ctx context.Context, volumeID string, publishContext map[string]string, stagingTargetPath string, capabilities *VolumeCapability, opts ...grpc.CallOption) error {
|
||||
if c == nil {
|
||||
return fmt.Errorf("Client not initialized")
|
||||
}
|
||||
@@ -325,7 +325,7 @@ func (c *client) NodeStageVolume(ctx context.Context, volumeID string, publishCo
|
||||
|
||||
// NodeStageVolume's response contains no extra data. If err == nil, we were
|
||||
// successful.
|
||||
_, err := c.nodeClient.NodeStageVolume(ctx, req)
|
||||
_, err := c.nodeClient.NodeStageVolume(ctx, req, opts...)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/hashicorp/nomad/plugins/base"
|
||||
"github.com/hashicorp/nomad/plugins/csi"
|
||||
"github.com/hashicorp/nomad/plugins/shared/hclspec"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
var _ csi.CSIPlugin = &Client{}
|
||||
@@ -161,7 +162,7 @@ func (c *Client) NodeGetInfo(ctx context.Context) (*csi.NodeGetInfoResponse, err
|
||||
// NodeStageVolume is used when a plugin has the STAGE_UNSTAGE volume capability
|
||||
// to prepare a volume for usage on a host. If err == nil, the response should
|
||||
// be assumed to be successful.
|
||||
func (c *Client) NodeStageVolume(ctx context.Context, volumeID string, publishContext map[string]string, stagingTargetPath string, capabilities *csi.VolumeCapability) error {
|
||||
func (c *Client) NodeStageVolume(ctx context.Context, volumeID string, publishContext map[string]string, stagingTargetPath string, capabilities *csi.VolumeCapability, opts ...grpc.CallOption) error {
|
||||
c.Mu.Lock()
|
||||
defer c.Mu.Unlock()
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
csipbv1 "github.com/container-storage-interface/spec/lib/go/csi"
|
||||
"github.com/hashicorp/nomad/plugins/base"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
// CSIPlugin implements a lightweight abstraction layer around a CSI Plugin.
|
||||
@@ -46,7 +47,7 @@ type CSIPlugin interface {
|
||||
// NodeStageVolume is used when a plugin has the STAGE_UNSTAGE volume capability
|
||||
// to prepare a volume for usage on a host. If err == nil, the response should
|
||||
// be assumed to be successful.
|
||||
NodeStageVolume(ctx context.Context, volumeID string, publishContext map[string]string, stagingTargetPath string, capabilities *VolumeCapability) error
|
||||
NodeStageVolume(ctx context.Context, volumeID string, publishContext map[string]string, stagingTargetPath string, capabilities *VolumeCapability, opts ...grpc.CallOption) error
|
||||
|
||||
// NodeUnstageVolume is used when a plugin has the STAGE_UNSTAGE volume capability
|
||||
// to undo the work performed by NodeStageVolume. If a volume has been staged,
|
||||
|
||||
Reference in New Issue
Block a user