mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Merge pull request #50243 from mborsz/node
Automatic merge from submit-queue (batch tested with PRs 50091, 50231, 50238, 50236, 50243) Fix storage tests for multizone test configuration. **What this PR does / why we need it**: This PR modifies "[sig-storage] Volumes PD should be mountable with (ext3|ext4)" tests to schedule pods in zone, where PD is created. This is to make the test work in multizone environment. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note ```
This commit is contained in:
commit
fddc7f3e50
@ -100,6 +100,8 @@ type VolumeTestConfig struct {
|
|||||||
ServerNodeName string
|
ServerNodeName string
|
||||||
// ClientNodeName is the spec.nodeName to run client pod on. Default is any node.
|
// ClientNodeName is the spec.nodeName to run client pod on. Default is any node.
|
||||||
ClientNodeName string
|
ClientNodeName string
|
||||||
|
// NodeSelector to use in pod spec (server, client and injector pods).
|
||||||
|
NodeSelector map[string]string
|
||||||
}
|
}
|
||||||
|
|
||||||
// VolumeTest contains a volume to mount into a client pod and its
|
// VolumeTest contains a volume to mount into a client pod and its
|
||||||
@ -286,6 +288,7 @@ func StartVolumeServer(client clientset.Interface, config VolumeTestConfig) *v1.
|
|||||||
Volumes: volumes,
|
Volumes: volumes,
|
||||||
RestartPolicy: restartPolicy,
|
RestartPolicy: restartPolicy,
|
||||||
NodeName: config.ServerNodeName,
|
NodeName: config.ServerNodeName,
|
||||||
|
NodeSelector: config.NodeSelector,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -390,8 +393,9 @@ func TestVolumeClient(client clientset.Interface, config VolumeTestConfig, fsGro
|
|||||||
Level: "s0:c0,c1",
|
Level: "s0:c0,c1",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Volumes: []v1.Volume{},
|
Volumes: []v1.Volume{},
|
||||||
NodeName: config.ClientNodeName,
|
NodeName: config.ClientNodeName,
|
||||||
|
NodeSelector: config.NodeSelector,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
podsNamespacer := client.CoreV1().Pods(config.Namespace)
|
podsNamespacer := client.CoreV1().Pods(config.Namespace)
|
||||||
@ -476,6 +480,7 @@ func InjectHtml(client clientset.Interface, config VolumeTestConfig, volume v1.V
|
|||||||
VolumeSource: volume,
|
VolumeSource: volume,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
NodeSelector: config.NodeSelector,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
"k8s.io/kubernetes/pkg/cloudprovider/providers/vsphere"
|
"k8s.io/kubernetes/pkg/cloudprovider/providers/vsphere"
|
||||||
|
kubeletapis "k8s.io/kubernetes/pkg/kubelet/apis"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -429,6 +430,11 @@ var _ = SIGDescribe("Volumes", func() {
|
|||||||
config = framework.VolumeTestConfig{
|
config = framework.VolumeTestConfig{
|
||||||
Namespace: namespace.Name,
|
Namespace: namespace.Name,
|
||||||
Prefix: "pd",
|
Prefix: "pd",
|
||||||
|
// PD will be created in framework.TestContext.CloudConfig.Zone zone,
|
||||||
|
// so pods should be also scheduled there.
|
||||||
|
NodeSelector: map[string]string{
|
||||||
|
kubeletapis.LabelZoneFailureDomain: framework.TestContext.CloudConfig.Zone,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user