diff --git a/lib/fluent/plugin/kubernetes_metadata_watch_namespaces.rb b/lib/fluent/plugin/kubernetes_metadata_watch_namespaces.rb index f74caa7..73459a0 100644 --- a/lib/fluent/plugin/kubernetes_metadata_watch_namespaces.rb +++ b/lib/fluent/plugin/kubernetes_metadata_watch_namespaces.rb @@ -47,6 +47,7 @@ def set_up_namespace_thread # rubocop:disable Metrics/AbcSize, Metrics/MethodLen @stats.bump(:namespace_watch_gone_errors) log.info('410 Gone encountered. Restarting namespace watch to reset resource versions.', e) namespace_watcher = nil + sleep 1 rescue KubeException => e if e.error_code == 401 # recreate client to refresh token diff --git a/lib/fluent/plugin/kubernetes_metadata_watch_pods.rb b/lib/fluent/plugin/kubernetes_metadata_watch_pods.rb index 8ba223d..3448a53 100644 --- a/lib/fluent/plugin/kubernetes_metadata_watch_pods.rb +++ b/lib/fluent/plugin/kubernetes_metadata_watch_pods.rb @@ -48,6 +48,7 @@ def set_up_pod_thread # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, M @stats.bump(:pod_watch_gone_errors) log.info('410 Gone encountered. Restarting pod watch to reset resource versions.', e) pod_watcher = nil + sleep 1 rescue KubeException => e if e.error_code == 401 # recreate client to refresh token