mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
Merge pull request #57037 from runcom/nfs-overlayfs
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. test: e2e: support NFS test on overlayfs TL;DR; NFS is not supported over overlayfs. In CRI-O we default to overlayfs as the storage driver, therefore running the NFS test always fails to export the directory. This patch adds a volume mount from the host so /exports isn't on overlayfs anymore. Signed-off-by: Antonio Murdaca <runcom@redhat.com> @Random-Liu @mrunalp PTAL - we got this after enabling all the e2e tests as discussed at kubecon (thanks!) ```release-note NONE ```
This commit is contained in:
commit
8ba39a3fcb
@ -83,6 +83,7 @@ type VolumeTestConfig struct {
|
|||||||
ServerArgs []string
|
ServerArgs []string
|
||||||
// Volumes needed to be mounted to the server container from the host
|
// Volumes needed to be mounted to the server container from the host
|
||||||
// map <host (source) path> -> <container (dst.) path>
|
// map <host (source) path> -> <container (dst.) path>
|
||||||
|
// if <host (source) path> is empty, mount a tmpfs emptydir
|
||||||
ServerVolumes map[string]string
|
ServerVolumes map[string]string
|
||||||
// Wait for the pod to terminate successfully
|
// Wait for the pod to terminate successfully
|
||||||
// False indicates that the pod is long running
|
// False indicates that the pod is long running
|
||||||
@ -106,10 +107,11 @@ type VolumeTest struct {
|
|||||||
// NFS-specific wrapper for CreateStorageServer.
|
// NFS-specific wrapper for CreateStorageServer.
|
||||||
func NewNFSServer(cs clientset.Interface, namespace string, args []string) (config VolumeTestConfig, pod *v1.Pod, ip string) {
|
func NewNFSServer(cs clientset.Interface, namespace string, args []string) (config VolumeTestConfig, pod *v1.Pod, ip string) {
|
||||||
config = VolumeTestConfig{
|
config = VolumeTestConfig{
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
Prefix: "nfs",
|
Prefix: "nfs",
|
||||||
ServerImage: imageutils.GetE2EImage(imageutils.VolumeNFSServer),
|
ServerImage: imageutils.GetE2EImage(imageutils.VolumeNFSServer),
|
||||||
ServerPorts: []int{2049},
|
ServerPorts: []int{2049},
|
||||||
|
ServerVolumes: map[string]string{"": "/exports"},
|
||||||
}
|
}
|
||||||
if len(args) > 0 {
|
if len(args) > 0 {
|
||||||
config.ServerArgs = args
|
config.ServerArgs = args
|
||||||
@ -230,8 +232,12 @@ func StartVolumeServer(client clientset.Interface, config VolumeTestConfig) *v1.
|
|||||||
for src, dst := range config.ServerVolumes {
|
for src, dst := range config.ServerVolumes {
|
||||||
mountName := fmt.Sprintf("path%d", i)
|
mountName := fmt.Sprintf("path%d", i)
|
||||||
volumes[i].Name = mountName
|
volumes[i].Name = mountName
|
||||||
volumes[i].VolumeSource.HostPath = &v1.HostPathVolumeSource{
|
if src == "" {
|
||||||
Path: src,
|
volumes[i].VolumeSource.EmptyDir = &v1.EmptyDirVolumeSource{Medium: v1.StorageMediumMemory}
|
||||||
|
} else {
|
||||||
|
volumes[i].VolumeSource.HostPath = &v1.HostPathVolumeSource{
|
||||||
|
Path: src,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mounts[i].Name = mountName
|
mounts[i].Name = mountName
|
||||||
|
Loading…
Reference in New Issue
Block a user