Add poll interval global variable

pull/10/head
stefanprodan 5 years ago
parent 6d66f42382
commit 1e03155e8b

@ -161,7 +161,7 @@ func createKsCmdRun(cmd *cobra.Command, args []string) error {
}
logWaiting("waiting for kustomization sync")
if err := wait.PollImmediate(2*time.Second, timeout,
if err := wait.PollImmediate(pollInterval, timeout,
isKustomizationReady(ctx, kubeClient, name, namespace)); err != nil {
return err
}

@ -3,21 +3,19 @@ package main
import (
"context"
"fmt"
"io/ioutil"
"net/url"
"os"
"strings"
"time"
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
"github.com/manifoldco/promptui"
"github.com/spf13/cobra"
"io/ioutil"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
"net/url"
"os"
"sigs.k8s.io/controller-runtime/pkg/client"
"strings"
)
var createSourceGitCmd = &cobra.Command{
@ -158,7 +156,7 @@ func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
}
logWaiting("waiting for git sync")
if err := wait.PollImmediate(2*time.Second, timeout,
if err := wait.PollImmediate(pollInterval, timeout,
isGitRepositoryReady(ctx, kubeClient, name, namespace)); err != nil {
return err
}

@ -56,6 +56,7 @@ var (
verbose bool
components []string
utils Utils
pollInterval = 2 * time.Second
)
func init() {

@ -82,7 +82,7 @@ func syncKsCmdRun(cmd *cobra.Command, args []string) error {
}
logWaiting("waiting for kustomization sync")
if err := wait.PollImmediate(2*time.Second, timeout,
if err := wait.PollImmediate(pollInterval, timeout,
isKustomizationReady(ctx, kubeClient, name, namespace)); err != nil {
return err
}

@ -64,7 +64,7 @@ func syncSourceGitCmdRun(cmd *cobra.Command, args []string) error {
logSuccess("source annotated")
logWaiting("waiting for git sync")
if err := wait.PollImmediate(2*time.Second, timeout,
if err := wait.PollImmediate(pollInterval, timeout,
isGitRepositoryReady(ctx, kubeClient, name, namespace)); err != nil {
return err
}

Loading…
Cancel
Save