Skip to content

Commit

Permalink
Merge pull request #33 from andrewsykim/consistent-sidecars
Browse files Browse the repository at this point in the history
Use GetDriverName from csi-lib-utils
  • Loading branch information
k8s-ci-robot authored Feb 27, 2019
2 parents ba6e2ee + bfbf0da commit 92fc6c3
Show file tree
Hide file tree
Showing 23 changed files with 325 additions and 3,455 deletions.
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

0 comments on commit 92fc6c3

Please sign in to comment.