diff --git a/lib/fluent/plugin/kubernetes_metadata_watch_namespaces.rb b/lib/fluent/plugin/kubernetes_metadata_watch_namespaces.rb index 26c470f..281ab80 100644 --- a/lib/fluent/plugin/kubernetes_metadata_watch_namespaces.rb +++ b/lib/fluent/plugin/kubernetes_metadata_watch_namespaces.rb @@ -113,6 +113,9 @@ def process_namespace_watcher_notices(watcher) # ignore and let age out for cases where # deleted but still processing logs @stats.bump(:namespace_cache_watch_deletes_ignored) + when 'ERROR' + message = notice['object']['message'] if notice['object'] && notice['object']['message'] + raise "Error while watching namespaces: #{message}" else # Don't pay attention to creations, since the created namespace may not # be used by any namespace on this node. diff --git a/lib/fluent/plugin/kubernetes_metadata_watch_pods.rb b/lib/fluent/plugin/kubernetes_metadata_watch_pods.rb index 02e1657..c8f7256 100644 --- a/lib/fluent/plugin/kubernetes_metadata_watch_pods.rb +++ b/lib/fluent/plugin/kubernetes_metadata_watch_pods.rb @@ -119,6 +119,9 @@ def process_pod_watcher_notices(watcher) # ignore and let age out for cases where pods # deleted but still processing logs @stats.bump(:pod_cache_watch_delete_ignored) + when 'ERROR' + message = notice['object']['message'] if notice['object'] && notice['object']['message'] + raise "Error while watching pods: #{message}" else # Don't pay attention to creations, since the created pod may not # end up on this node.