mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
CSI code changes
This commit is contained in:
parent
e3c8ed2377
commit
c8956fa93c
4
Godeps/Godeps.json
generated
4
Godeps/Godeps.json
generated
@ -452,9 +452,9 @@
|
|||||||
"Rev": "8d75e11374a1928608c906fe745b538483e7aeb2"
|
"Rev": "8d75e11374a1928608c906fe745b538483e7aeb2"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/container-storage-interface/spec/lib/go/csi",
|
"ImportPath": "github.com/container-storage-interface/spec/lib/go/csi/v0",
|
||||||
"Comment": "v0.1.0-5-g7ab01a9",
|
"Comment": "v0.1.0-5-g7ab01a9",
|
||||||
"Rev": "91c189774c16b0661255943c09ea9d97d5a423e7"
|
"Rev": "31c167062b1a62a9810e4fd94d7c986113b490b8"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/containerd/console",
|
"ImportPath": "github.com/containerd/console",
|
||||||
|
2
Godeps/LICENSES
generated
2
Godeps/LICENSES
generated
@ -12786,7 +12786,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
= vendor/github.com/container-storage-interface/spec/lib/go/csi licensed under: =
|
= vendor/github.com/container-storage-interface/spec/lib/go/csi/v0 licensed under: =
|
||||||
|
|
||||||
Apache License
|
Apache License
|
||||||
Version 2.0, January 2004
|
Version 2.0, January 2004
|
||||||
|
@ -16,7 +16,7 @@ go_library(
|
|||||||
"//pkg/util/strings:go_default_library",
|
"//pkg/util/strings:go_default_library",
|
||||||
"//pkg/volume:go_default_library",
|
"//pkg/volume:go_default_library",
|
||||||
"//pkg/volume/util:go_default_library",
|
"//pkg/volume/util:go_default_library",
|
||||||
"//vendor/github.com/container-storage-interface/spec/lib/go/csi:go_default_library",
|
"//vendor/github.com/container-storage-interface/spec/lib/go/csi/v0:go_default_library",
|
||||||
"//vendor/github.com/golang/glog:go_default_library",
|
"//vendor/github.com/golang/glog:go_default_library",
|
||||||
"//vendor/golang.org/x/net/context:go_default_library",
|
"//vendor/golang.org/x/net/context:go_default_library",
|
||||||
"//vendor/google.golang.org/grpc:go_default_library",
|
"//vendor/google.golang.org/grpc:go_default_library",
|
||||||
@ -43,7 +43,6 @@ go_test(
|
|||||||
"//pkg/volume:go_default_library",
|
"//pkg/volume:go_default_library",
|
||||||
"//pkg/volume/csi/fake:go_default_library",
|
"//pkg/volume/csi/fake:go_default_library",
|
||||||
"//pkg/volume/testing:go_default_library",
|
"//pkg/volume/testing:go_default_library",
|
||||||
"//vendor/github.com/container-storage-interface/spec/lib/go/csi:go_default_library",
|
|
||||||
"//vendor/golang.org/x/net/context:go_default_library",
|
"//vendor/golang.org/x/net/context:go_default_library",
|
||||||
"//vendor/google.golang.org/grpc:go_default_library",
|
"//vendor/google.golang.org/grpc:go_default_library",
|
||||||
"//vendor/k8s.io/api/core/v1:go_default_library",
|
"//vendor/k8s.io/api/core/v1:go_default_library",
|
||||||
|
@ -17,13 +17,11 @@ limitations under the License.
|
|||||||
package csi
|
package csi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"net"
|
"net"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
csipb "github.com/container-storage-interface/spec/lib/go/csi"
|
csipb "github.com/container-storage-interface/spec/lib/go/csi/v0"
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
grpctx "golang.org/x/net/context"
|
grpctx "golang.org/x/net/context"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
@ -31,7 +29,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type csiClient interface {
|
type csiClient interface {
|
||||||
AssertSupportedVersion(ctx grpctx.Context, ver *csipb.Version) error
|
|
||||||
NodePublishVolume(
|
NodePublishVolume(
|
||||||
ctx grpctx.Context,
|
ctx grpctx.Context,
|
||||||
volumeid string,
|
volumeid string,
|
||||||
@ -40,14 +37,13 @@ type csiClient interface {
|
|||||||
accessMode api.PersistentVolumeAccessMode,
|
accessMode api.PersistentVolumeAccessMode,
|
||||||
volumeInfo map[string]string,
|
volumeInfo map[string]string,
|
||||||
volumeAttribs map[string]string,
|
volumeAttribs map[string]string,
|
||||||
nodePublishCredentials map[string]string,
|
nodePublishSecrets map[string]string,
|
||||||
fsType string,
|
fsType string,
|
||||||
) error
|
) error
|
||||||
NodeUnpublishVolume(
|
NodeUnpublishVolume(
|
||||||
ctx grpctx.Context,
|
ctx grpctx.Context,
|
||||||
volID string,
|
volID string,
|
||||||
targetPath string,
|
targetPath string,
|
||||||
nodeUnpublishCredentials map[string]string,
|
|
||||||
) error
|
) error
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,63 +90,6 @@ func (c *csiDriverClient) assertConnection() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// AssertSupportedVersion ensures driver supports specified spec version.
|
|
||||||
// If version is not supported, the assertion fails with an error.
|
|
||||||
// This test should be done early during the storage operation flow to avoid
|
|
||||||
// unnecessary calls later.
|
|
||||||
// `ver` argument holds the expected supported version.
|
|
||||||
func (c *csiDriverClient) AssertSupportedVersion(ctx grpctx.Context, ver *csipb.Version) error {
|
|
||||||
if c.versionAsserted {
|
|
||||||
if !c.versionSupported {
|
|
||||||
return fmt.Errorf("version %s not supported", verToStr(ver))
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := c.assertConnection(); err != nil {
|
|
||||||
c.versionAsserted = false
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
glog.V(4).Info(log("asserting version supported by driver"))
|
|
||||||
rsp, err := c.idClient.GetSupportedVersions(ctx, &csipb.GetSupportedVersionsRequest{})
|
|
||||||
if err != nil {
|
|
||||||
c.versionAsserted = false
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
supported := false
|
|
||||||
vers := rsp.GetSupportedVersions()
|
|
||||||
glog.V(4).Info(log("driver reports %d versions supported: %s", len(vers), versToStr(vers)))
|
|
||||||
|
|
||||||
// If our supported version is still at 0.X.X, then check
|
|
||||||
// also the minor number. If our supported version is >= 1.X.X
|
|
||||||
// then check only the major number.
|
|
||||||
for _, v := range vers {
|
|
||||||
if ver.GetMajor() == int32(0) &&
|
|
||||||
(ver.GetMajor() == v.GetMajor() && ver.GetMinor() == v.GetMinor()) {
|
|
||||||
supported = true
|
|
||||||
break
|
|
||||||
} else if ver.GetMajor() != int32(0) && ver.GetMajor() == v.GetMajor() {
|
|
||||||
supported = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
c.versionAsserted = true
|
|
||||||
c.versionSupported = supported
|
|
||||||
|
|
||||||
if !supported {
|
|
||||||
return fmt.Errorf(
|
|
||||||
"CSI Driver does not support version %s. Instead it supports versions %s",
|
|
||||||
verToStr(ver),
|
|
||||||
versToStr(vers))
|
|
||||||
}
|
|
||||||
|
|
||||||
glog.V(4).Info(log("version %s supported", verToStr(ver)))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *csiDriverClient) NodePublishVolume(
|
func (c *csiDriverClient) NodePublishVolume(
|
||||||
ctx grpctx.Context,
|
ctx grpctx.Context,
|
||||||
volID string,
|
volID string,
|
||||||
@ -159,7 +98,7 @@ func (c *csiDriverClient) NodePublishVolume(
|
|||||||
accessMode api.PersistentVolumeAccessMode,
|
accessMode api.PersistentVolumeAccessMode,
|
||||||
volumeInfo map[string]string,
|
volumeInfo map[string]string,
|
||||||
volumeAttribs map[string]string,
|
volumeAttribs map[string]string,
|
||||||
nodePublishCredentials map[string]string,
|
nodePublishSecrets map[string]string,
|
||||||
fsType string,
|
fsType string,
|
||||||
) error {
|
) error {
|
||||||
glog.V(4).Info(log("calling NodePublishVolume rpc [volid=%s,target_path=%s]", volID, targetPath))
|
glog.V(4).Info(log("calling NodePublishVolume rpc [volid=%s,target_path=%s]", volID, targetPath))
|
||||||
@ -175,13 +114,12 @@ func (c *csiDriverClient) NodePublishVolume(
|
|||||||
}
|
}
|
||||||
|
|
||||||
req := &csipb.NodePublishVolumeRequest{
|
req := &csipb.NodePublishVolumeRequest{
|
||||||
Version: csiVersion,
|
VolumeId: volID,
|
||||||
VolumeId: volID,
|
TargetPath: targetPath,
|
||||||
TargetPath: targetPath,
|
Readonly: readOnly,
|
||||||
Readonly: readOnly,
|
PublishInfo: volumeInfo,
|
||||||
PublishInfo: volumeInfo,
|
VolumeAttributes: volumeAttribs,
|
||||||
VolumeAttributes: volumeAttribs,
|
NodePublishSecrets: nodePublishSecrets,
|
||||||
NodePublishCredentials: nodePublishCredentials,
|
|
||||||
VolumeCapability: &csipb.VolumeCapability{
|
VolumeCapability: &csipb.VolumeCapability{
|
||||||
AccessMode: &csipb.VolumeCapability_AccessMode{
|
AccessMode: &csipb.VolumeCapability_AccessMode{
|
||||||
Mode: asCSIAccessMode(accessMode),
|
Mode: asCSIAccessMode(accessMode),
|
||||||
@ -198,7 +136,7 @@ func (c *csiDriverClient) NodePublishVolume(
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *csiDriverClient) NodeUnpublishVolume(ctx grpctx.Context, volID string, targetPath string, nodeUnpublishCredentials map[string]string) error {
|
func (c *csiDriverClient) NodeUnpublishVolume(ctx grpctx.Context, volID string, targetPath string) error {
|
||||||
glog.V(4).Info(log("calling NodeUnpublishVolume rpc: [volid=%s, target_path=%s", volID, targetPath))
|
glog.V(4).Info(log("calling NodeUnpublishVolume rpc: [volid=%s, target_path=%s", volID, targetPath))
|
||||||
if volID == "" {
|
if volID == "" {
|
||||||
return errors.New("missing volume id")
|
return errors.New("missing volume id")
|
||||||
@ -212,10 +150,8 @@ func (c *csiDriverClient) NodeUnpublishVolume(ctx grpctx.Context, volID string,
|
|||||||
}
|
}
|
||||||
|
|
||||||
req := &csipb.NodeUnpublishVolumeRequest{
|
req := &csipb.NodeUnpublishVolumeRequest{
|
||||||
Version: csiVersion,
|
VolumeId: volID,
|
||||||
VolumeId: volID,
|
TargetPath: targetPath,
|
||||||
TargetPath: targetPath,
|
|
||||||
NodeUnpublishCredentials: nodeUnpublishCredentials,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := c.nodeClient.NodeUnpublishVolume(ctx, req)
|
_, err := c.nodeClient.NodeUnpublishVolume(ctx, req)
|
||||||
@ -233,22 +169,3 @@ func asCSIAccessMode(am api.PersistentVolumeAccessMode) csipb.VolumeCapability_A
|
|||||||
}
|
}
|
||||||
return csipb.VolumeCapability_AccessMode_UNKNOWN
|
return csipb.VolumeCapability_AccessMode_UNKNOWN
|
||||||
}
|
}
|
||||||
|
|
||||||
func verToStr(ver *csipb.Version) string {
|
|
||||||
if ver == nil {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("%d.%d.%d", ver.GetMajor(), ver.GetMinor(), ver.GetPatch())
|
|
||||||
}
|
|
||||||
|
|
||||||
func versToStr(vers []*csipb.Version) string {
|
|
||||||
if vers == nil {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
str := bytes.NewBufferString("[")
|
|
||||||
for _, v := range vers {
|
|
||||||
str.WriteString(fmt.Sprintf("{%s};", verToStr(v)))
|
|
||||||
}
|
|
||||||
str.WriteString("]")
|
|
||||||
return str.String()
|
|
||||||
}
|
|
||||||
|
@ -20,7 +20,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
csipb "github.com/container-storage-interface/spec/lib/go/csi"
|
|
||||||
grpctx "golang.org/x/net/context"
|
grpctx "golang.org/x/net/context"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
api "k8s.io/api/core/v1"
|
api "k8s.io/api/core/v1"
|
||||||
@ -39,35 +38,6 @@ func setupClient(t *testing.T) *csiDriverClient {
|
|||||||
return client
|
return client
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestClientAssertSupportedVersion(t *testing.T) {
|
|
||||||
testCases := []struct {
|
|
||||||
testName string
|
|
||||||
ver *csipb.Version
|
|
||||||
mustFail bool
|
|
||||||
err error
|
|
||||||
}{
|
|
||||||
{testName: "supported version", ver: &csipb.Version{Major: 0, Minor: 0, Patch: 0}},
|
|
||||||
{testName: "supported version", ver: &csipb.Version{Major: 0, Minor: 1, Patch: 0}},
|
|
||||||
{testName: "supported version", ver: &csipb.Version{Major: 0, Minor: 1, Patch: 10}},
|
|
||||||
{testName: "supported version", ver: &csipb.Version{Major: 0, Minor: 2, Patch: 0}},
|
|
||||||
{testName: "supported version", ver: &csipb.Version{Major: 1, Minor: 1, Patch: 0}},
|
|
||||||
{testName: "supported version", ver: &csipb.Version{Major: 1, Minor: 0, Patch: 10}},
|
|
||||||
{testName: "unsupported version", ver: &csipb.Version{Major: 10, Minor: 0, Patch: 0}, mustFail: true},
|
|
||||||
{testName: "unsupported version", ver: &csipb.Version{Major: 0, Minor: 10, Patch: 0}, mustFail: true},
|
|
||||||
{testName: "grpc error", ver: &csipb.Version{Major: 0, Minor: 1, Patch: 0}, mustFail: true, err: errors.New("grpc error")},
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, tc := range testCases {
|
|
||||||
t.Logf("test case: %s", tc.testName)
|
|
||||||
client := setupClient(t)
|
|
||||||
client.idClient.(*fake.IdentityClient).SetNextError(tc.err)
|
|
||||||
err := client.AssertSupportedVersion(grpctx.Background(), tc.ver)
|
|
||||||
if tc.mustFail && err == nil {
|
|
||||||
t.Error("test must fail, but err = nil")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestClientNodePublishVolume(t *testing.T) {
|
func TestClientNodePublishVolume(t *testing.T) {
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
@ -126,8 +96,7 @@ func TestClientNodeUnpublishVolume(t *testing.T) {
|
|||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
t.Logf("test case: %s", tc.name)
|
t.Logf("test case: %s", tc.name)
|
||||||
client.nodeClient.(*fake.NodeClient).SetNextError(tc.err)
|
client.nodeClient.(*fake.NodeClient).SetNextError(tc.err)
|
||||||
nodeUnpublishCredentials := map[string]string{}
|
err := client.NodeUnpublishVolume(grpctx.Background(), tc.volID, tc.targetPath)
|
||||||
err := client.NodeUnpublishVolume(grpctx.Background(), tc.volID, tc.targetPath, nodeUnpublishCredentials)
|
|
||||||
if tc.mustFail && err == nil {
|
if tc.mustFail && err == nil {
|
||||||
t.Error("test must fail, but err is nil")
|
t.Error("test must fail, but err is nil")
|
||||||
}
|
}
|
||||||
|
@ -121,12 +121,6 @@ func (c *csiMountMgr) SetUpAt(dir string, fsGroup *int64) error {
|
|||||||
nodeName := string(c.plugin.host.GetNodeName())
|
nodeName := string(c.plugin.host.GetNodeName())
|
||||||
attachID := getAttachmentName(csiSource.VolumeHandle, csiSource.Driver, nodeName)
|
attachID := getAttachmentName(csiSource.VolumeHandle, csiSource.Driver, nodeName)
|
||||||
|
|
||||||
// ensure version is supported
|
|
||||||
if err := csi.AssertSupportedVersion(ctx, csiVersion); err != nil {
|
|
||||||
glog.Error(log("mounter.SetUpAt failed to assert version: %v", err))
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// search for attachment by VolumeAttachment.Spec.Source.PersistentVolumeName
|
// search for attachment by VolumeAttachment.Spec.Source.PersistentVolumeName
|
||||||
if c.volumeInfo == nil {
|
if c.volumeInfo == nil {
|
||||||
attachment, err := c.k8s.StorageV1beta1().VolumeAttachments().Get(attachID, meta.GetOptions{})
|
attachment, err := c.k8s.StorageV1beta1().VolumeAttachments().Get(attachID, meta.GetOptions{})
|
||||||
@ -179,9 +173,9 @@ func (c *csiMountMgr) SetUpAt(dir string, fsGroup *int64) error {
|
|||||||
if len(fsType) == 0 {
|
if len(fsType) == 0 {
|
||||||
fsType = defaultFSType
|
fsType = defaultFSType
|
||||||
}
|
}
|
||||||
nodePublishCredentials := map[string]string{}
|
nodePublishSecrets := map[string]string{}
|
||||||
if csiSource.NodePublishSecretRef != nil {
|
if csiSource.NodePublishSecretRef != nil {
|
||||||
nodePublishCredentials = getCredentialsFromSecret(c.k8s, csiSource.NodePublishSecretRef)
|
nodePublishSecrets = getCredentialsFromSecret(c.k8s, csiSource.NodePublishSecretRef)
|
||||||
}
|
}
|
||||||
err = csi.NodePublishVolume(
|
err = csi.NodePublishVolume(
|
||||||
ctx,
|
ctx,
|
||||||
@ -191,7 +185,7 @@ func (c *csiMountMgr) SetUpAt(dir string, fsGroup *int64) error {
|
|||||||
accessMode,
|
accessMode,
|
||||||
c.volumeInfo,
|
c.volumeInfo,
|
||||||
attribs,
|
attribs,
|
||||||
nodePublishCredentials,
|
nodePublishSecrets,
|
||||||
fsType,
|
fsType,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -239,7 +233,6 @@ func (c *csiMountMgr) TearDownAt(dir string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
csiSource, err := getCSISourceFromSpec(c.spec)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Error(log("mounter.TearDownAt failed to get CSI persistent source: %v", err))
|
glog.Error(log("mounter.TearDownAt failed to get CSI persistent source: %v", err))
|
||||||
return err
|
return err
|
||||||
@ -268,17 +261,7 @@ func (c *csiMountMgr) TearDownAt(dir string) error {
|
|||||||
|
|
||||||
csi := c.csiClient
|
csi := c.csiClient
|
||||||
|
|
||||||
// TODO make all assertion calls private within the client itself
|
if err := csi.NodeUnpublishVolume(ctx, volID, dir); err != nil {
|
||||||
if err := csi.AssertSupportedVersion(ctx, csiVersion); err != nil {
|
|
||||||
glog.Errorf(log("mounter.TearDownAt failed to assert version: %v", err))
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
nodeUnpublishCredentials := map[string]string{}
|
|
||||||
if csiSource.NodePublishSecretRef != nil {
|
|
||||||
nodeUnpublishCredentials = getCredentialsFromSecret(c.k8s, csiSource.NodePublishSecretRef)
|
|
||||||
}
|
|
||||||
if err := csi.NodeUnpublishVolume(ctx, volID, dir, nodeUnpublishCredentials); err != nil {
|
|
||||||
glog.Errorf(log("mounter.TearDownAt failed: %v", err))
|
glog.Errorf(log("mounter.TearDownAt failed: %v", err))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
csipb "github.com/container-storage-interface/spec/lib/go/csi"
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
api "k8s.io/api/core/v1"
|
api "k8s.io/api/core/v1"
|
||||||
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@ -43,11 +42,6 @@ const (
|
|||||||
volDataFileName = "vol_data.json"
|
volDataFileName = "vol_data.json"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
// csiVersion supported csi version
|
|
||||||
csiVersion = &csipb.Version{Major: 0, Minor: 2, Patch: 0}
|
|
||||||
)
|
|
||||||
|
|
||||||
type csiPlugin struct {
|
type csiPlugin struct {
|
||||||
host volume.VolumeHost
|
host volume.VolumeHost
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ go_library(
|
|||||||
importpath = "k8s.io/kubernetes/pkg/volume/csi/fake",
|
importpath = "k8s.io/kubernetes/pkg/volume/csi/fake",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
"//vendor/github.com/container-storage-interface/spec/lib/go/csi:go_default_library",
|
"//vendor/github.com/container-storage-interface/spec/lib/go/csi/v0:go_default_library",
|
||||||
"//vendor/golang.org/x/net/context:go_default_library",
|
"//vendor/golang.org/x/net/context:go_default_library",
|
||||||
"//vendor/google.golang.org/grpc:go_default_library",
|
"//vendor/google.golang.org/grpc:go_default_library",
|
||||||
],
|
],
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
csipb "github.com/container-storage-interface/spec/lib/go/csi"
|
csipb "github.com/container-storage-interface/spec/lib/go/csi/v0"
|
||||||
grpctx "golang.org/x/net/context"
|
grpctx "golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -42,26 +42,6 @@ func (f *IdentityClient) SetNextError(err error) {
|
|||||||
f.nextErr = err
|
f.nextErr = err
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetSupportedVersions returns supported version
|
|
||||||
func (f *IdentityClient) GetSupportedVersions(ctx grpctx.Context, req *csipb.GetSupportedVersionsRequest, opts ...grpc.CallOption) (*csipb.GetSupportedVersionsResponse, error) {
|
|
||||||
// short circuit with an error
|
|
||||||
if f.nextErr != nil {
|
|
||||||
return nil, f.nextErr
|
|
||||||
}
|
|
||||||
|
|
||||||
rsp := &csipb.GetSupportedVersionsResponse{
|
|
||||||
SupportedVersions: []*csipb.Version{
|
|
||||||
{Major: 0, Minor: 0, Patch: 1},
|
|
||||||
{Major: 0, Minor: 1, Patch: 0},
|
|
||||||
{Major: 0, Minor: 2, Patch: 0},
|
|
||||||
{Major: 1, Minor: 0, Patch: 0},
|
|
||||||
{Major: 1, Minor: 0, Patch: 1},
|
|
||||||
{Major: 1, Minor: 1, Patch: 1},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
return rsp, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetPluginInfo returns plugin info
|
// GetPluginInfo returns plugin info
|
||||||
func (f *IdentityClient) GetPluginInfo(ctx context.Context, in *csipb.GetPluginInfoRequest, opts ...grpc.CallOption) (*csipb.GetPluginInfoResponse, error) {
|
func (f *IdentityClient) GetPluginInfo(ctx context.Context, in *csipb.GetPluginInfoRequest, opts ...grpc.CallOption) (*csipb.GetPluginInfoResponse, error) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
2975
vendor/github.com/container-storage-interface/spec/lib/go/csi/csi.pb.go
generated
vendored
2975
vendor/github.com/container-storage-interface/spec/lib/go/csi/csi.pb.go
generated
vendored
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user