diff --git a/cmd/execute.go b/cmd/execute.go index 0e9c137..a92162f 100644 --- a/cmd/execute.go +++ b/cmd/execute.go @@ -137,7 +137,7 @@ func init() { RootCmd.PersistentFlags().IntVarP(&healthP, "healthcheck-port", "p", 0, "Port for answering healthchecks on /health url") bindPFlag("healthcheck-port", "healthcheck-port") - RootCmd.PersistentFlags().IntVarP(&resync, "resync-interval", "i", 300, "Resync interval in seconds (0 to disable)") + RootCmd.PersistentFlags().IntVarP(&resync, "resync-interval", "i", 900, "Full resync interval in seconds (0 to disable)") bindPFlag("resync-interval", "resync-interval") } diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index 48969e2..220b384 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -27,7 +27,8 @@ import ( var ( maxProcessRetry = 6 - canaryKey = "$katafygio-canary" + canaryKey = "$katafygio canary$" + unexported = []string{"selfLink", "uid", "resourceVersion", "generation"} ) // Interface describe a standard kubernetes controller @@ -67,7 +68,7 @@ func New(client cache.ListerWatcher, notifier event.Notifier, name string, confi informer := cache.NewSharedIndexInformer( lw, &unstructured.Unstructured{}, - config.ResyncIntv, + config.ResyncIntv*time.Second, cache.Indexers{}, ) @@ -193,12 +194,11 @@ func (c *Controller) processItem(key string) error { // clear irrelevant attributes uc := obj.UnstructuredContent() - md := uc["metadata"].(map[string]interface{}) delete(uc, "status") - delete(md, "selfLink") - delete(md, "uid") - delete(md, "resourceVersion") - delete(md, "generation") + md := uc["metadata"].(map[string]interface{}) + for _, attr := range unexported { + delete(md, attr) + } c.config.Logger.Debugf("Found %s/%s [%s]", obj.GetAPIVersion(), obj.GetKind(), key)