Fixes static check failures in test/e2e_node/*

This commit is contained in:
Nabarun Pal
2019-08-26 13:27:25 +05:30
parent b327a729c5
commit 83c443e728
10 changed files with 20 additions and 41 deletions

View File

@@ -87,16 +87,24 @@ func checkIPTables() (err error) {
func checkPublicGCR() error {
const image = "k8s.gcr.io/busybox"
output, err := runCommand("docker", "images", "-q", image)
if err != nil {
return err
}
if len(output) != 0 {
if _, err := runCommand("docker", "rmi", "-f", image); err != nil {
return err
}
}
output, err = runCommand("docker", "pull", image)
if err != nil {
return err
}
if len(output) == 0 {
return fmt.Errorf("failed to pull %s", image)
}
if _, err = runCommand("docker", "rmi", "-f", image); err != nil {
if _, err := runCommand("docker", "rmi", "-f", image); err != nil {
return err
}
return nil