Embed VolumeSource in v1beta3 and internal.

This commit is contained in:
Brendan Burns
2015-03-03 14:48:55 -08:00
parent 6f85bd0c66
commit fb90b56bf6
29 changed files with 122 additions and 96 deletions

View File

@@ -51,15 +51,15 @@ func (nodes ClientNodeInfo) GetNodeInfo(nodeID string) (*api.Node, error) {
}
func isVolumeConflict(volume api.Volume, pod *api.Pod) bool {
if volume.Source.GCEPersistentDisk == nil {
if volume.GCEPersistentDisk == nil {
return false
}
pdName := volume.Source.GCEPersistentDisk.PDName
pdName := volume.GCEPersistentDisk.PDName
manifest := &(pod.Spec)
for ix := range manifest.Volumes {
if manifest.Volumes[ix].Source.GCEPersistentDisk != nil &&
manifest.Volumes[ix].Source.GCEPersistentDisk.PDName == pdName {
if manifest.Volumes[ix].GCEPersistentDisk != nil &&
manifest.Volumes[ix].GCEPersistentDisk.PDName == pdName {
return true
}
}

View File

@@ -276,7 +276,7 @@ func TestDiskConflicts(t *testing.T) {
volState := api.PodSpec{
Volumes: []api.Volume{
{
Source: api.VolumeSource{
VolumeSource: api.VolumeSource{
GCEPersistentDisk: &api.GCEPersistentDiskVolumeSource{
PDName: "foo",
},
@@ -287,7 +287,7 @@ func TestDiskConflicts(t *testing.T) {
volState2 := api.PodSpec{
Volumes: []api.Volume{
{
Source: api.VolumeSource{
VolumeSource: api.VolumeSource{
GCEPersistentDisk: &api.GCEPersistentDiskVolumeSource{
PDName: "bar",
},