Skip to content

Commit 79230ee

Browse files
committed
Fix hostpath subpath reconstruction tests are failing
Fixes: kubernetes#68093
1 parent bd2370d commit 79230ee

File tree

2 files changed

+42
-42
lines changed

2 files changed

+42
-42
lines changed

test/e2e/storage/drivers/in_tree.go

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -649,21 +649,21 @@ func (c *cephFSDriver) DeleteVolume(volType testpatterns.TestVolType) {
649649
}
650650

651651
// Hostpath
652-
type hostpathDriver struct {
652+
type hostPathDriver struct {
653653
node v1.Node
654654

655655
driverInfo DriverInfo
656656
}
657657

658-
var _ TestDriver = &hostpathDriver{}
659-
var _ PreprovisionedVolumeTestDriver = &hostpathDriver{}
660-
var _ InlineVolumeTestDriver = &hostpathDriver{}
658+
var _ TestDriver = &hostPathDriver{}
659+
var _ PreprovisionedVolumeTestDriver = &hostPathDriver{}
660+
var _ InlineVolumeTestDriver = &hostPathDriver{}
661661

662-
// InitHostpathDriver returns hostpathDriver that implements TestDriver interface
663-
func InitHostpathDriver() TestDriver {
664-
return &hostpathDriver{
662+
// InitHostpathDriver returns hostPathDriver that implements TestDriver interface
663+
func InitHostPathDriver() TestDriver {
664+
return &hostPathDriver{
665665
driverInfo: DriverInfo{
666-
Name: "hostpath",
666+
Name: "hostPath",
667667
MaxFileSize: testpatterns.FileSizeMedium,
668668
SupportedFsType: sets.NewString(
669669
"", // Default fsType
@@ -675,15 +675,15 @@ func InitHostpathDriver() TestDriver {
675675
}
676676
}
677677

678-
func (h *hostpathDriver) GetDriverInfo() *DriverInfo {
678+
func (h *hostPathDriver) GetDriverInfo() *DriverInfo {
679679
return &h.driverInfo
680680
}
681681

682-
func (h *hostpathDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
682+
func (h *hostPathDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
683683
}
684684

685-
func (h *hostpathDriver) GetVolumeSource(readOnly bool, fsType string) *v1.VolumeSource {
686-
// hostpath doesn't support readOnly volume
685+
func (h *hostPathDriver) GetVolumeSource(readOnly bool, fsType string) *v1.VolumeSource {
686+
// hostPath doesn't support readOnly volume
687687
if readOnly {
688688
return nil
689689
}
@@ -694,13 +694,13 @@ func (h *hostpathDriver) GetVolumeSource(readOnly bool, fsType string) *v1.Volum
694694
}
695695
}
696696

697-
func (h *hostpathDriver) CreateDriver() {
697+
func (h *hostPathDriver) CreateDriver() {
698698
}
699699

700-
func (h *hostpathDriver) CleanupDriver() {
700+
func (h *hostPathDriver) CleanupDriver() {
701701
}
702702

703-
func (h *hostpathDriver) CreateVolume(volType testpatterns.TestVolType) {
703+
func (h *hostPathDriver) CreateVolume(volType testpatterns.TestVolType) {
704704
f := h.driverInfo.Framework
705705
cs := f.ClientSet
706706

@@ -710,11 +710,11 @@ func (h *hostpathDriver) CreateVolume(volType testpatterns.TestVolType) {
710710
h.driverInfo.Config.ClientNodeName = node.Name
711711
}
712712

713-
func (h *hostpathDriver) DeleteVolume(volType testpatterns.TestVolType) {
713+
func (h *hostPathDriver) DeleteVolume(volType testpatterns.TestVolType) {
714714
}
715715

716-
// HostpathSymlink
717-
type hostpathSymlinkDriver struct {
716+
// HostPathSymlink
717+
type hostPathSymlinkDriver struct {
718718
node v1.Node
719719
sourcePath string
720720
targetPath string
@@ -723,15 +723,15 @@ type hostpathSymlinkDriver struct {
723723
driverInfo DriverInfo
724724
}
725725

726-
var _ TestDriver = &hostpathSymlinkDriver{}
727-
var _ PreprovisionedVolumeTestDriver = &hostpathSymlinkDriver{}
728-
var _ InlineVolumeTestDriver = &hostpathSymlinkDriver{}
726+
var _ TestDriver = &hostPathSymlinkDriver{}
727+
var _ PreprovisionedVolumeTestDriver = &hostPathSymlinkDriver{}
728+
var _ InlineVolumeTestDriver = &hostPathSymlinkDriver{}
729729

730-
// InitHostpathSymlinkDriver returns hostpathSymlinkDriver that implements TestDriver interface
731-
func InitHostpathSymlinkDriver() TestDriver {
732-
return &hostpathSymlinkDriver{
730+
// InitHostPathSymlinkDriver returns hostPathSymlinkDriver that implements TestDriver interface
731+
func InitHostPathSymlinkDriver() TestDriver {
732+
return &hostPathSymlinkDriver{
733733
driverInfo: DriverInfo{
734-
Name: "hostpathSymlink",
734+
Name: "hostPathSymlink",
735735
MaxFileSize: testpatterns.FileSizeMedium,
736736
SupportedFsType: sets.NewString(
737737
"", // Default fsType
@@ -743,15 +743,15 @@ func InitHostpathSymlinkDriver() TestDriver {
743743
}
744744
}
745745

746-
func (h *hostpathSymlinkDriver) GetDriverInfo() *DriverInfo {
746+
func (h *hostPathSymlinkDriver) GetDriverInfo() *DriverInfo {
747747
return &h.driverInfo
748748
}
749749

750-
func (h *hostpathSymlinkDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
750+
func (h *hostPathSymlinkDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
751751
}
752752

753-
func (h *hostpathSymlinkDriver) GetVolumeSource(readOnly bool, fsType string) *v1.VolumeSource {
754-
// hostpath doesn't support readOnly volume
753+
func (h *hostPathSymlinkDriver) GetVolumeSource(readOnly bool, fsType string) *v1.VolumeSource {
754+
// hostPathSymlink doesn't support readOnly volume
755755
if readOnly {
756756
return nil
757757
}
@@ -762,13 +762,13 @@ func (h *hostpathSymlinkDriver) GetVolumeSource(readOnly bool, fsType string) *v
762762
}
763763
}
764764

765-
func (h *hostpathSymlinkDriver) CreateDriver() {
765+
func (h *hostPathSymlinkDriver) CreateDriver() {
766766
}
767767

768-
func (h *hostpathSymlinkDriver) CleanupDriver() {
768+
func (h *hostPathSymlinkDriver) CleanupDriver() {
769769
}
770770

771-
func (h *hostpathSymlinkDriver) CreateVolume(volType testpatterns.TestVolType) {
771+
func (h *hostPathSymlinkDriver) CreateVolume(volType testpatterns.TestVolType) {
772772
f := h.driverInfo.Framework
773773
cs := f.ClientSet
774774

@@ -784,7 +784,7 @@ func (h *hostpathSymlinkDriver) CreateVolume(volType testpatterns.TestVolType) {
784784
cmd := fmt.Sprintf("mkdir %v -m 777 && ln -s %v %v", h.sourcePath, h.sourcePath, h.targetPath)
785785
privileged := true
786786

787-
// Launch pod to initialize hostpath directory and symlink
787+
// Launch pod to initialize hostPath directory and symlink
788788
h.prepPod = &v1.Pod{
789789
ObjectMeta: metav1.ObjectMeta{
790790
Name: fmt.Sprintf("hostpath-symlink-prep-%s", f.Namespace.Name),
@@ -822,29 +822,29 @@ func (h *hostpathSymlinkDriver) CreateVolume(volType testpatterns.TestVolType) {
822822
}
823823
// h.prepPod will be reused in cleanupDriver.
824824
pod, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(h.prepPod)
825-
Expect(err).ToNot(HaveOccurred(), "while creating hostpath init pod")
825+
Expect(err).ToNot(HaveOccurred(), "while creating hostPath init pod")
826826

827827
err = framework.WaitForPodSuccessInNamespace(f.ClientSet, pod.Name, pod.Namespace)
828-
Expect(err).ToNot(HaveOccurred(), "while waiting for hostpath init pod to succeed")
828+
Expect(err).ToNot(HaveOccurred(), "while waiting for hostPath init pod to succeed")
829829

830830
err = framework.DeletePodWithWait(f, f.ClientSet, pod)
831-
Expect(err).ToNot(HaveOccurred(), "while deleting hostpath init pod")
831+
Expect(err).ToNot(HaveOccurred(), "while deleting hostPath init pod")
832832
}
833833

834-
func (h *hostpathSymlinkDriver) DeleteVolume(volType testpatterns.TestVolType) {
834+
func (h *hostPathSymlinkDriver) DeleteVolume(volType testpatterns.TestVolType) {
835835
f := h.driverInfo.Framework
836836

837837
cmd := fmt.Sprintf("rm -rf %v&& rm -rf %v", h.targetPath, h.sourcePath)
838838
h.prepPod.Spec.Containers[0].Command = []string{"/bin/sh", "-ec", cmd}
839839

840840
pod, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(h.prepPod)
841-
Expect(err).ToNot(HaveOccurred(), "while creating hostpath teardown pod")
841+
Expect(err).ToNot(HaveOccurred(), "while creating hostPath teardown pod")
842842

843843
err = framework.WaitForPodSuccessInNamespace(f.ClientSet, pod.Name, pod.Namespace)
844-
Expect(err).ToNot(HaveOccurred(), "while waiting for hostpath teardown pod to succeed")
844+
Expect(err).ToNot(HaveOccurred(), "while waiting for hostPath teardown pod to succeed")
845845

846846
err = framework.DeletePodWithWait(f, f.ClientSet, pod)
847-
Expect(err).ToNot(HaveOccurred(), "while deleting hostpath teardown pod")
847+
Expect(err).ToNot(HaveOccurred(), "while deleting hostPath teardown pod")
848848
}
849849

850850
// emptydir

test/e2e/storage/in_tree_volumes.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ var testDrivers = []func() drivers.TestDriver{
3434
drivers.InitISCSIDriver,
3535
drivers.InitRbdDriver,
3636
drivers.InitCephFSDriver,
37-
drivers.InitHostpathDriver,
38-
drivers.InitHostpathSymlinkDriver,
37+
drivers.InitHostPathDriver,
38+
drivers.InitHostPathSymlinkDriver,
3939
drivers.InitEmptydirDriver,
4040
drivers.InitCinderDriver,
4141
drivers.InitGceDriver,

0 commit comments

Comments
 (0)