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

Update CSINodeInfo #101

Merged
merged 3 commits into from
Nov 27, 2018
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
195 changes: 47 additions & 148 deletions Gopkg.lock

Large diffs are not rendered by default.

22 changes: 14 additions & 8 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,24 @@
name = "google.golang.org/grpc"
version = "1.9.2"

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

// TODO: use [[constraint]] when kubernetes-csi/kubernetes-csi-migration-library uses 1.13 code
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[[override]]
name = "k8s.io/api"
version = "kubernetes-1.12.1"
version = "kubernetes-1.13.0-beta.2"

[[constraint]]
[[override]]
name = "k8s.io/apimachinery"
version = "kubernetes-1.12.0"
version = "kubernetes-1.13.0-beta.2"

[[constraint]]
[[override]]
name = "k8s.io/client-go"
version = "kubernetes-1.12.0"
version = "kubernetes-1.13.0-beta.2"


[[override]]
name = "github.com/json-iterator/go"
version = "1.1.4"
name = "k8s.io/csi-api"
version = "kubernetes-1.13.0-beta.2"
9 changes: 4 additions & 5 deletions pkg/controller/csi_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import (

"github.com/golang/glog"

"github.com/kubernetes-csi/external-attacher/pkg/connection"

csiMigration "github.com/kubernetes-csi/kubernetes-csi-migration-library"
"k8s.io/api/core/v1"
storage "k8s.io/api/storage/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -31,12 +34,8 @@ import (
corelisters "k8s.io/client-go/listers/core/v1"
storagelisters "k8s.io/client-go/listers/storage/v1beta1"
"k8s.io/client-go/util/workqueue"
csilisters "k8s.io/csi-api/pkg/client/listers/csi/v1alpha1"

"github.com/kubernetes-csi/external-attacher/pkg/connection"

csiMigration "github.com/kubernetes-csi/kubernetes-csi-migration-library"
csiclient "k8s.io/csi-api/pkg/client/clientset/versioned"
csilisters "k8s.io/csi-api/pkg/client/listers/csi/v1alpha1"
)

// csiHandler is a handler that calls CSI to attach/detach volume.
Expand Down
12 changes: 7 additions & 5 deletions pkg/controller/csi_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,12 @@ func csiNodeInfo() *csiapi.CSINodeInfo {
ObjectMeta: metav1.ObjectMeta{
Name: testNodeName,
},
CSIDrivers: []csiapi.CSIDriverInfo{
{
Driver: testAttacherName,
NodeID: testNodeID,
Spec: csiapi.CSINodeInfoSpec{
Drivers: []csiapi.CSIDriverInfoSpec{
{
Name: testAttacherName,
NodeID: testNodeID,
},
},
},
}
Expand All @@ -201,7 +203,7 @@ func csiNodeInfoEmpty() *csiapi.CSINodeInfo {
ObjectMeta: metav1.ObjectMeta{
Name: testNodeName,
},
CSIDrivers: []csiapi.CSIDriverInfo{},
Spec: csiapi.CSINodeInfoSpec{Drivers: []csiapi.CSIDriverInfoSpec{}},
}
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ func GetNodeIDFromNode(driver string, node *v1.Node) (string, error) {
}

func GetNodeIDFromNodeInfo(driver string, nodeInfo *csiapi.CSINodeInfo) (string, bool) {
for _, d := range nodeInfo.CSIDrivers {
if d.Driver == driver {
for _, d := range nodeInfo.Spec.Drivers {
if d.Name == driver {
return d.NodeID, true
}
}
Expand Down
16 changes: 16 additions & 0 deletions vendor/github.com/evanphx/json-patch/.travis.yml

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

25 changes: 25 additions & 0 deletions vendor/github.com/evanphx/json-patch/LICENSE

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

Loading