Rename volume source types to be consistent.

This commit is contained in:
Tim Hockin
2015-02-19 22:27:27 -08:00
parent 8bdfc352ce
commit 607b736a3f
19 changed files with 110 additions and 110 deletions

View File

@@ -36,7 +36,7 @@ func TestCanSupport(t *testing.T) {
if plug.Name() != "kubernetes.io/empty-dir" {
t.Errorf("Wrong name: %s", plug.Name())
}
if !plug.CanSupport(&api.Volume{Source: api.VolumeSource{EmptyDir: &api.EmptyDir{}}}) {
if !plug.CanSupport(&api.Volume{Source: api.VolumeSource{EmptyDir: &api.EmptyDirVolumeSource{}}}) {
t.Errorf("Expected true")
}
if !plug.CanSupport(&api.Volume{Source: api.VolumeSource{}}) {
@@ -54,7 +54,7 @@ func TestPlugin(t *testing.T) {
}
spec := &api.Volume{
Name: "vol1",
Source: api.VolumeSource{EmptyDir: &api.EmptyDir{}},
Source: api.VolumeSource{EmptyDir: &api.EmptyDirVolumeSource{}},
}
builder, err := plug.NewBuilder(spec, types.UID("poduid"))
if err != nil {
@@ -134,11 +134,11 @@ func TestPluginLegacy(t *testing.T) {
if plug.Name() != "empty" {
t.Errorf("Wrong name: %s", plug.Name())
}
if plug.CanSupport(&api.Volume{Source: api.VolumeSource{EmptyDir: &api.EmptyDir{}}}) {
if plug.CanSupport(&api.Volume{Source: api.VolumeSource{EmptyDir: &api.EmptyDirVolumeSource{}}}) {
t.Errorf("Expected false")
}
if _, err := plug.NewBuilder(&api.Volume{Source: api.VolumeSource{EmptyDir: &api.EmptyDir{}}}, types.UID("poduid")); err == nil {
if _, err := plug.NewBuilder(&api.Volume{Source: api.VolumeSource{EmptyDir: &api.EmptyDirVolumeSource{}}}, types.UID("poduid")); err == nil {
t.Errorf("Expected failiure")
}