Change:
In bare-metal IPv6 environment, any pod consuming storage resource is not able to run. The storage should be consumable, and the pod should become in status. Running the in a bare-metal IPv6 configurations. I have replaced the cloud-based storage resource with a mounted to a folder on my localhost. Steps alongside logs are below :- $kubectl get svc $kubectl describe svc nfs-server $kubectl describe pv nfs $kubectl get pod -w $kubectl get pod -w $kubectl describe pod nfs-busybox-6r96h I have built the master branch to make sure it was not fixed up to this moment.
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the label and provide further guidance. The label can be by org members by writing in a comment. <detailsInstructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
/sig storage
/sig storage /tirage accepted /assign

Discussion:
import ( "fmt" <ins> netutil "k8s.io/utils/net" </ins> "os" "runtime" "time"

if err != nil { return nil, err } return &nfsMounter{ nfs: &nfs{ volName:         spec.Name(),

plugin:          plugin, MetricsProvider: volume.NewMetricsStatFS(getPath(pod.UID, spec.Name(), plugin.host)), }, <del> server:       source.Server, </del> <ins> server:       getServerFromSource(source), </ins> exportPath:   source.Path, readOnly:     readOnly, mountOptions: util.MountOptionFromSpec(spec),

return nil, false, fmt.Errorf("Spec does not reference a NFS volume type") } <ins> func getServerFromSource(source *v1.NFSVolumeSource) string { if netutil.IsIPv6String(source.Server) { return fmt.Sprintf("[%s]", source.Server) } return source.Server } </ins>

} } <del> func doTestPlugin(t *testing.T, spec *volume.Spec) { </del> <ins> func doTestPlugin(t *testing.T, spec *volume.Spec, expectedDevice string) { </ins> tmpDir, err := utiltesting.MkTmpdir("nfs_test") if err != nil { t.Fatalf("error creating temp dir: %v", err)

if mounter.(*nfsMounter).readOnly { t.Errorf("The volume source should not be read-only and it is.") } <ins> mntDevs, err := fake.List() if err != nil { t.Errorf("fakeMounter.List() failed: %v", err) } if len(mntDevs) != 1 { t.Errorf("unexpected number of mounted devices. expected: %v, got %v", 1, len(mntDevs)) } else { if mntDevs[0].Type != "nfs" { t.Errorf("unexpected type of mounted devices. expected: %v, got %v", "nfs", mntDevs[0].Type) } if mntDevs[0].Device != expectedDevice { t.Errorf("unexpected nfs device, expected %q, got: %q", expectedDevice, mntDevs[0].Device) } } </ins> log := fake.GetLog() if len(log) != 1 { t.Errorf("Mount was not called exactly one time. It was called %d times.", len(log))

Name:         "vol1", VolumeSource: v1.VolumeSource{NFS: &v1.NFSVolumeSource{Server: "localhost", Path: "/somepath", ReadOnly: false}}, } <del> doTestPlugin(t, volume.NewSpecFromVolume(vol)) </del> <ins> doTestPlugin(t, volume.NewSpecFromVolume(vol), "localhost:/somepath") } func TestIPV6VolumeSource(t *testing.T) { vol := &v1.Volume{ Name:         "vol1", VolumeSource: v1.VolumeSource{NFS: &v1.NFSVolumeSource{Server: "0:0:0:0:0:0:0:1", Path: "/somepath", ReadOnly: false}}, } doTestPlugin(t, volume.NewSpecFromVolume(vol), "[0:0:0:0:0:0:0:1]:/somepath") } func TestIPV4VolumeSource(t *testing.T) { vol := &v1.Volume{ Name:         "vol1", VolumeSource: v1.VolumeSource{NFS: &v1.NFSVolumeSource{Server: "127.0.0.1", Path: "/somepath", ReadOnly: false}}, } doTestPlugin(t, volume.NewSpecFromVolume(vol), "127.0.0.1:/somepath") </ins> } func TestPluginPersistentVolume(t *testing.T) {

}, } <del> doTestPlugin(t, volume.NewSpecFromPersistentVolume(vol, false)) </del> <ins> doTestPlugin(t, volume.NewSpecFromPersistentVolume(vol, false), "localhost:/somepath") </ins> } func TestPersistentClaimReadOnlyFlag(t *testing.T) {