mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-12 20:57:20 +00:00
Embed VolumeSource in v1beta3 and internal.
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
@@ -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",
|
||||
},
|
||||
|
Reference in New Issue
Block a user