Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GetDriverName from csi-lib-utils #33

Merged
merged 2 commits into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 6 additions & 32 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 1 addition & 10 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,17 @@
# name = "github.com/x/y"
# version = "2.4.0"

[[constraint]]
name = "github.com/container-storage-interface/spec"
version = "1.0.0"

[[override]]
name = "github.com/golang/protobuf"
version = "v1.1.0"

[[constraint]]
name = "github.com/kubernetes-csi/csi-test"
version = "v1.0.0-1"


[[override]]
name = "github.com/json-iterator/go"
version = "1.1.4"

[[constraint]]
name = "github.com/kubernetes-csi/csi-lib-utils"
version = "0.3.0"
version = ">=0.4.0-rc1"

[prune]
non-go = true
Expand Down
17 changes: 9 additions & 8 deletions cmd/csi-node-driver-registrar/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import (
"k8s.io/klog"
registerapi "k8s.io/kubernetes/pkg/kubelet/apis/pluginregistration/v1alpha1"

"github.com/kubernetes-csi/node-driver-registrar/pkg/connection"
"github.com/kubernetes-csi/csi-lib-utils/connection"
csirpc "github.com/kubernetes-csi/csi-lib-utils/rpc"
)

const (
Expand Down Expand Up @@ -116,23 +117,23 @@ func main() {
// resolved, if plugin does not support PUBLISH_UNPUBLISH_VOLUME, then we
// can skip adding mapping to "csi.volume.kubernetes.io/nodeid" annotation.

// Connect to CSI.
klog.V(1).Infof("Attempting to open a gRPC connection with: %q", *csiAddress)
csiConn, err := connection.NewConnection(*csiAddress)
csiConn, err := connection.Connect(*csiAddress)
if err != nil {
klog.Error(err.Error())
klog.Errorf("error connecting to CSI driver: %v", err)
os.Exit(1)
}

// Get CSI driver name.
klog.V(1).Infof("Calling CSI driver to discover driver name.")
klog.V(1).Infof("Calling CSI driver to discover driver name")
ctx, cancel := context.WithTimeout(context.Background(), csiTimeout)
defer cancel()
csiDriverName, err := csiConn.GetDriverName(ctx)

csiDriverName, err := csirpc.GetDriverName(ctx, csiConn)
if err != nil {
klog.Error(err.Error())
klog.Errorf("error retreiving CSI driver name: %v", err)
os.Exit(1)
}

klog.V(2).Infof("CSI driver name: %q", csiDriverName)

// Run forever
Expand Down
70 changes: 0 additions & 70 deletions pkg/connection/connection.go

This file was deleted.

54 changes: 0 additions & 54 deletions pkg/connection/connection_test.go

This file was deleted.

12 changes: 0 additions & 12 deletions vendor/github.com/golang/mock/AUTHORS

This file was deleted.

37 changes: 0 additions & 37 deletions vendor/github.com/golang/mock/CONTRIBUTORS

This file was deleted.

Loading