Skip to content

Commit

Permalink
Improve Pod's watcher options
Browse files Browse the repository at this point in the history
Signed-off-by: chrismark <chrismarkou92@gmail.com>
  • Loading branch information
ChrsMark committed Jul 13, 2021
1 parent 4f12589 commit 929c183
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
// Config for kubernetes provider
type Config struct {
KubeConfig string `config:"kube_config"`
Namespace string `config:"namespace"`
SyncPeriod time.Duration `config:"sync_period"`
CleanupTimeout time.Duration `config:"cleanup_timeout" validate:"positive"`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ type podData struct {
// NewPodWatcher creates a watcher that can discover and process pod objects
func NewPodWatcher(comm composable.DynamicProviderComm, cfg *Config, logger *logp.Logger, client k8s.Interface) (kubernetes.Watcher, error) {
watcher, err := kubernetes.NewWatcher(client, &kubernetes.Pod{}, kubernetes.WatchOptions{
SyncTimeout: cfg.SyncPeriod,
Node: cfg.Node,
//Namespace: p.config.Namespace,
SyncTimeout: cfg.SyncPeriod,
Node: cfg.Node,
Namespace: cfg.Namespace,
HonorReSyncs: true,
}, nil)
if err != nil {
return nil, errors.New(err, "couldn't create kubernetes watcher")
Expand Down

0 comments on commit 929c183

Please sign in to comment.