mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Remove unused functions from hack/e2e.go.
This commit is contained in:
		
							
								
								
									
										42
									
								
								hack/e2e.go
									
									
									
									
									
								
							
							
						
						
									
										42
									
								
								hack/e2e.go
									
									
									
									
									
								
							@@ -18,12 +18,10 @@ limitations under the License.
 | 
				
			|||||||
package main
 | 
					package main
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"bytes"
 | 
					 | 
				
			||||||
	"flag"
 | 
						"flag"
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"io"
 | 
						"io"
 | 
				
			||||||
	"log"
 | 
						"log"
 | 
				
			||||||
	"math/rand"
 | 
					 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
	"os/exec"
 | 
						"os/exec"
 | 
				
			||||||
@@ -256,14 +254,6 @@ func PrepareVersion(version string) (string, error) {
 | 
				
			|||||||
	return localReleaseDir, nil
 | 
						return localReleaseDir, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Fisher-Yates shuffle using the given RNG r
 | 
					 | 
				
			||||||
func shuffleStrings(strings []string, r *rand.Rand) {
 | 
					 | 
				
			||||||
	for i := len(strings) - 1; i > 0; i-- {
 | 
					 | 
				
			||||||
		j := r.Intn(i + 1)
 | 
					 | 
				
			||||||
		strings[i], strings[j] = strings[j], strings[i]
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func Test() bool {
 | 
					func Test() bool {
 | 
				
			||||||
	if !IsUp() {
 | 
						if !IsUp() {
 | 
				
			||||||
		log.Fatal("Testing requested, but e2e cluster not up!")
 | 
							log.Fatal("Testing requested, but e2e cluster not up!")
 | 
				
			||||||
@@ -274,25 +264,6 @@ func Test() bool {
 | 
				
			|||||||
	return finishRunning("Ginkgo tests", exec.Command(filepath.Join(*root, "hack/ginkgo-e2e.sh"), strings.Fields(*testArgs)...))
 | 
						return finishRunning("Ginkgo tests", exec.Command(filepath.Join(*root, "hack/ginkgo-e2e.sh"), strings.Fields(*testArgs)...))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// All nonsense below is temporary until we have go versions of these things.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// call the returned anonymous function to stop.
 | 
					 | 
				
			||||||
func runBashUntil(stepName string, cmd *exec.Cmd) func() {
 | 
					 | 
				
			||||||
	log.Printf("Running in background: %v", stepName)
 | 
					 | 
				
			||||||
	output := bytes.NewBuffer(nil)
 | 
					 | 
				
			||||||
	cmd.Stdout, cmd.Stderr = output, output
 | 
					 | 
				
			||||||
	if err := cmd.Start(); err != nil {
 | 
					 | 
				
			||||||
		log.Printf("Unable to start '%v': '%v'", stepName, err)
 | 
					 | 
				
			||||||
		return func() {}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	return func() {
 | 
					 | 
				
			||||||
		cmd.Process.Signal(os.Interrupt)
 | 
					 | 
				
			||||||
		headerprefix := stepName + " "
 | 
					 | 
				
			||||||
		lineprefix := "  "
 | 
					 | 
				
			||||||
		printBashOutputs(headerprefix, lineprefix, string(output.Bytes()), false)
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func finishRunning(stepName string, cmd *exec.Cmd) bool {
 | 
					func finishRunning(stepName string, cmd *exec.Cmd) bool {
 | 
				
			||||||
	if *verbose {
 | 
						if *verbose {
 | 
				
			||||||
		cmd.Stdout = os.Stdout
 | 
							cmd.Stdout = os.Stdout
 | 
				
			||||||
@@ -310,19 +281,6 @@ func finishRunning(stepName string, cmd *exec.Cmd) bool {
 | 
				
			|||||||
	return true
 | 
						return true
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func printBashOutputs(headerprefix, lineprefix, output string, escape bool) {
 | 
					 | 
				
			||||||
	if output != "" {
 | 
					 | 
				
			||||||
		fmt.Printf("%voutput: |\n", headerprefix)
 | 
					 | 
				
			||||||
		printPrefixedLines(lineprefix, output)
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func printPrefixedLines(prefix, s string) {
 | 
					 | 
				
			||||||
	for _, line := range strings.Split(s, "\n") {
 | 
					 | 
				
			||||||
		fmt.Printf("%v%v\n", prefix, line)
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// returns either "", or a list of args intended for appending with the
 | 
					// returns either "", or a list of args intended for appending with the
 | 
				
			||||||
// kubectl command (beginning with a space).
 | 
					// kubectl command (beginning with a space).
 | 
				
			||||||
func kubectlArgs() string {
 | 
					func kubectlArgs() string {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user