Skip to content
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
  •  
  •  
  •  
118 changes: 97 additions & 21 deletions Gopkg.lock

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

12 changes: 6 additions & 6 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,29 @@
name = "github.com/golang/glog"

[[constraint]]
branch = "master"
name = "github.com/kubernetes-csi/external-snapshotter"
version = "v0.4.1"

[[constraint]]
name = "github.com/kubernetes-incubator/external-storage"
version = "kubernetes-1.12.0-beta.1"
version = "v5.2.0"

[[constraint]]
name = "google.golang.org/grpc"
version = "1.9.2"

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

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

[[constraint]]
name = "k8s.io/api"
version = "kubernetes-1.12.0-beta.1"
version = "kubernetes-1.12.0"

[[constraint]]
name = "k8s.io/csi-api"
version = "kubernetes-1.12.0-beta.1"
version = "kubernetes-1.12.0"
4 changes: 2 additions & 2 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ func (p *csiProvisioner) Provision(options controller.VolumeOptions) (*v1.Persis
if options.PVC.Spec.DataSource.Kind != snapshotKind {
return nil, fmt.Errorf("the PVC source is not the right type. Expected %s, Got %s", snapshotKind, options.PVC.Spec.DataSource.Kind)
}
if options.PVC.Spec.DataSource.APIGroup != snapshotAPIGroup {
return nil, fmt.Errorf("the PVC source does not belong to the right APIGroup. Expected %s, Got %s", snapshotAPIGroup, options.PVC.Spec.DataSource.APIGroup)
if *(options.PVC.Spec.DataSource.APIGroup) != snapshotAPIGroup {
return nil, fmt.Errorf("the PVC source does not belong to the right APIGroup. Expected %s, Got %s", snapshotAPIGroup, *(options.PVC.Spec.DataSource.APIGroup))
}
needSnapshotSupport = true
}
Expand Down
18 changes: 10 additions & 8 deletions pkg/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ func newSnapshot(name, className, boundToContent, snapshotUID, claimName string,
}

// newContent returns a new content with given attributes
func newContent(name, className, snapshotHandle, volumeUID, volumeName, boundToSnapshotUID, boundToSnapshotName string, size *resource.Quantity, creationTime *int64) *crdv1.VolumeSnapshotContent {
func newContent(name, className, snapshotHandle, volumeUID, volumeName, boundToSnapshotUID, boundToSnapshotName string, size *int64, creationTime *int64) *crdv1.VolumeSnapshotContent {
content := crdv1.VolumeSnapshotContent{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Expand Down Expand Up @@ -1219,6 +1219,8 @@ func newContent(name, className, snapshotHandle, volumeUID, volumeName, boundToS

// TestProvisionFromSnapshot tests create volume from snapshot
func TestProvisionFromSnapshot(t *testing.T) {
var apiGrp string = "snapshot.storage.k8s.io"
var unsupportedAPIGrp string = "unsupported.group.io"
var requestedBytes int64 = 1000
var snapName string = "test-snapshot"
var snapClassName string = "test-snapclass"
Expand Down Expand Up @@ -1262,7 +1264,7 @@ func TestProvisionFromSnapshot(t *testing.T) {
DataSource: &v1.TypedLocalObjectReference{
Name: snapName,
Kind: "VolumeSnapshot",
APIGroup: "snapshot.storage.k8s.io",
APIGroup: &apiGrp,
},
},
},
Expand Down Expand Up @@ -1304,7 +1306,7 @@ func TestProvisionFromSnapshot(t *testing.T) {
DataSource: &v1.TypedLocalObjectReference{
Name: snapName,
Kind: "VolumeSnapshot",
APIGroup: "snapshot.storage.k8s.io",
APIGroup: &apiGrp,
},
},
},
Expand Down Expand Up @@ -1332,7 +1334,7 @@ func TestProvisionFromSnapshot(t *testing.T) {
DataSource: &v1.TypedLocalObjectReference{
Name: "",
Kind: "VolumeSnapshot",
APIGroup: "snapshot.storage.k8s.io",
APIGroup: &apiGrp,
},
},
},
Expand All @@ -1359,7 +1361,7 @@ func TestProvisionFromSnapshot(t *testing.T) {
DataSource: &v1.TypedLocalObjectReference{
Name: "",
Kind: "UnsupportedKind",
APIGroup: "snapshot.storage.k8s.io",
APIGroup: &apiGrp,
},
},
},
Expand All @@ -1386,7 +1388,7 @@ func TestProvisionFromSnapshot(t *testing.T) {
DataSource: &v1.TypedLocalObjectReference{
Name: snapName,
Kind: "VolumeSnapshot",
APIGroup: "unsupported.group.io",
APIGroup: &unsupportedAPIGrp,
},
},
},
Expand All @@ -1413,7 +1415,7 @@ func TestProvisionFromSnapshot(t *testing.T) {
DataSource: &v1.TypedLocalObjectReference{
Name: snapName,
Kind: "VolumeSnapshot",
APIGroup: "snapshot.storage.k8s.io",
APIGroup: &apiGrp,
},
},
},
Expand Down Expand Up @@ -1442,7 +1444,7 @@ func TestProvisionFromSnapshot(t *testing.T) {
})

client.AddReactor("get", "volumesnapshotcontents", func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) {
content := newContent("snapcontent-snapuid", snapClassName, "sid", "pv-uid", "volume", "snapuid", snapName, resource.NewQuantity(requestedBytes, resource.BinarySI), &timeNow)
content := newContent("snapcontent-snapuid", snapClassName, "sid", "pv-uid", "volume", "snapuid", snapName, &requestedBytes, &timeNow)
return true, content, nil
})

Expand Down

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

Loading