Decrease time and repeats on kubectl 77/1477/1
authorYolanda Robla <yroblamo@redhat.com>
Wed, 28 Aug 2019 09:39:57 +0000 (11:39 +0200)
committerYolanda Robla <yroblamo@redhat.com>
Wed, 28 Aug 2019 09:40:35 +0000 (11:40 +0200)
Signed-off-by: Yolanda Robla <yroblamo@redhat.com>
Change-Id: Ibb28da9017a7828011443f67c014c0f0300db1e8

pkg/utils/utils.go

index b9128c5..6f2ae59 100644 (file)
@@ -69,7 +69,7 @@ func ApplyKubectl(kubectlBinary string, kubectlContent []byte, kubeconfigPath st
        }
 
        envVars := []string{fmt.Sprintf("KUBECONFIG=%s", kubeconfigPath)}
-       for i := 1; i <= 10; i++ {
+       for i := 1; i <= 5; i++ {
                _, err := ExecuteCommand("", envVars, false, true, kubectlBinary, "apply", "-f", tmpFile.Name())
 
                if err == nil {
@@ -78,7 +78,7 @@ func ApplyKubectl(kubectlBinary string, kubectlContent []byte, kubeconfigPath st
                } else {
                        log.Println(string(err))
                        // sleep and retry
-                       time.Sleep(60 * time.Second)
+                       time.Sleep(30 * time.Second)
                }
        }
 }