@@ -523,7 +523,7 @@ func testVolumeContent(client clientset.Interface, pod *v1.Pod, fsGroup *int64,
523
523
if test .Mode == v1 .PersistentVolumeBlock {
524
524
// Block: check content
525
525
deviceName := fmt .Sprintf ("/opt/%d" , i )
526
- commands := GenerateReadBlockCmd (deviceName , len (test .ExpectedContent ))
526
+ commands := generateReadBlockCmd (deviceName , len (test .ExpectedContent ))
527
527
_ , err := framework .LookForStringInPodExec (pod .Namespace , pod .Name , commands , test .ExpectedContent , time .Minute )
528
528
framework .ExpectNoError (err , "failed: finding the contents of the block device %s." , deviceName )
529
529
@@ -532,7 +532,7 @@ func testVolumeContent(client clientset.Interface, pod *v1.Pod, fsGroup *int64,
532
532
} else {
533
533
// Filesystem: check content
534
534
fileName := fmt .Sprintf ("/opt/%d/%s" , i , test .File )
535
- commands := GenerateReadFileCmd (fileName )
535
+ commands := generateReadFileCmd (fileName )
536
536
_ , err := framework .LookForStringInPodExec (pod .Namespace , pod .Name , commands , test .ExpectedContent , time .Minute )
537
537
framework .ExpectNoError (err , "failed: finding the contents of the mounted file %s." , fileName )
538
538
@@ -593,12 +593,12 @@ func InjectContent(client clientset.Interface, config TestConfig, fsGroup *int64
593
593
if test .Mode == v1 .PersistentVolumeBlock {
594
594
// Block: write content
595
595
deviceName := fmt .Sprintf ("/opt/%d" , i )
596
- commands = append (commands , GenerateWriteBlockCmd (test .ExpectedContent , deviceName )... )
596
+ commands = append (commands , generateWriteBlockCmd (test .ExpectedContent , deviceName )... )
597
597
598
598
} else {
599
599
// Filesystem: write content
600
600
fileName := fmt .Sprintf ("/opt/%d/%s" , i , test .File )
601
- commands = append (commands , GenerateWriteFileCmd (test .ExpectedContent , fileName )... )
601
+ commands = append (commands , generateWriteFileCmd (test .ExpectedContent , fileName )... )
602
602
}
603
603
out , err := framework .RunKubectl (commands ... )
604
604
framework .ExpectNoError (err , "failed: writing the contents: %s" , out )
@@ -634,9 +634,9 @@ func GenerateScriptCmd(command string) []string {
634
634
return commands
635
635
}
636
636
637
- // GenerateWriteBlockCmd generates the corresponding command lines to write to a block device the given content.
637
+ // generateWriteBlockCmd generates the corresponding command lines to write to a block device the given content.
638
638
// Depending on the Node OS is Windows or linux, the command will use powershell or /bin/sh
639
- func GenerateWriteBlockCmd (content , fullPath string ) []string {
639
+ func generateWriteBlockCmd (content , fullPath string ) []string {
640
640
var commands []string
641
641
if ! framework .NodeOSDistroIs ("windows" ) {
642
642
commands = []string {"/bin/sh" , "-c" , "echo '" + content + "' > " + fullPath }
@@ -646,9 +646,9 @@ func GenerateWriteBlockCmd(content, fullPath string) []string {
646
646
return commands
647
647
}
648
648
649
- // GenerateWriteFileCmd generates the corresponding command lines to write a file with the given content and file path.
649
+ // generateWriteFileCmd generates the corresponding command lines to write a file with the given content and file path.
650
650
// Depending on the Node OS is Windows or linux, the command will use powershell or /bin/sh
651
- func GenerateWriteFileCmd (content , fullPath string ) []string {
651
+ func generateWriteFileCmd (content , fullPath string ) []string {
652
652
var commands []string
653
653
if ! framework .NodeOSDistroIs ("windows" ) {
654
654
commands = []string {"/bin/sh" , "-c" , "echo '" + content + "' > " + fullPath }
@@ -658,9 +658,9 @@ func GenerateWriteFileCmd(content, fullPath string) []string {
658
658
return commands
659
659
}
660
660
661
- // GenerateReadFileCmd generates the corresponding command lines to read from a file with the given file path.
661
+ // generateReadFileCmd generates the corresponding command lines to read from a file with the given file path.
662
662
// Depending on the Node OS is Windows or linux, the command will use powershell or /bin/sh
663
- func GenerateReadFileCmd (fullPath string ) []string {
663
+ func generateReadFileCmd (fullPath string ) []string {
664
664
var commands []string
665
665
if ! framework .NodeOSDistroIs ("windows" ) {
666
666
commands = []string {"cat" , fullPath }
@@ -670,9 +670,9 @@ func GenerateReadFileCmd(fullPath string) []string {
670
670
return commands
671
671
}
672
672
673
- // GenerateReadBlockCmd generates the corresponding command lines to read from a block device with the given file path.
673
+ // generateReadBlockCmd generates the corresponding command lines to read from a block device with the given file path.
674
674
// Depending on the Node OS is Windows or linux, the command will use powershell or /bin/sh
675
- func GenerateReadBlockCmd (fullPath string , numberOfCharacters int ) []string {
675
+ func generateReadBlockCmd (fullPath string , numberOfCharacters int ) []string {
676
676
var commands []string
677
677
if ! framework .NodeOSDistroIs ("windows" ) {
678
678
commands = []string {"head" , "-c" , strconv .Itoa (numberOfCharacters ), fullPath }
0 commit comments