diff --git a/manifests/phases/executors.yaml b/manifests/phases/executors.yaml index 04df91765..d8e08540e 100644 --- a/manifests/phases/executors.yaml +++ b/manifests/phases/executors.yaml @@ -20,6 +20,7 @@ metadata: config: waitOptions: timeout: 5000 + pollInterval: 30 pruneOptions: prune: false --- diff --git a/pkg/api/v1alpha1/kubernetes_apply_types.go b/pkg/api/v1alpha1/kubernetes_apply_types.go index c40053e5a..0fa08e4c2 100644 --- a/pkg/api/v1alpha1/kubernetes_apply_types.go +++ b/pkg/api/v1alpha1/kubernetes_apply_types.go @@ -38,6 +38,8 @@ type ApplyConfig struct { type ApplyWaitOptions struct { // Timeout in seconds Timeout int `json:"timeout,omitempty"` + // PollInterval in seconds + PollInterval int `json:"pollInterval,omitempty"` } // ApplyPruneOptions provides instructions how to prune for kubernetes resources diff --git a/pkg/k8s/applier/apply_options.go b/pkg/k8s/applier/apply_options.go index bf6827970..ba69bed76 100644 --- a/pkg/k8s/applier/apply_options.go +++ b/pkg/k8s/applier/apply_options.go @@ -23,6 +23,7 @@ import ( // ApplyOptions struct that hold options for apply operation type ApplyOptions struct { WaitTimeout time.Duration + PollInterval time.Duration DryRunStrategy common.DryRunStrategy Prune bool BundleName string diff --git a/pkg/phase/executors/k8s_applier.go b/pkg/phase/executors/k8s_applier.go index e0fc1b9de..47a06b1ca 100644 --- a/pkg/phase/executors/k8s_applier.go +++ b/pkg/phase/executors/k8s_applier.go @@ -95,6 +95,7 @@ func (e *KubeApplierExecutor) Run(ch chan events.Event, runOpts ifc.RunOptions) if runOpts.Timeout != nil { timeout = *runOpts.Timeout } + pollInterval := time.Second * time.Duration(e.apiObject.Config.WaitOptions.PollInterval) log.Debugf("WaitTimeout: %v", timeout) applyOptions := k8sapplier.ApplyOptions{ @@ -102,6 +103,7 @@ func (e *KubeApplierExecutor) Run(ch chan events.Event, runOpts ifc.RunOptions) Prune: e.apiObject.Config.PruneOptions.Prune, BundleName: e.BundleName, WaitTimeout: timeout, + PollInterval: pollInterval, } applier.ApplyBundle(filteredBundle, applyOptions) }