Skip to content

Commit

Permalink
fix #228. Don't report cache miss if skipping namespace metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
jcantrill committed Jan 22, 2021
1 parent 4bb52f5 commit 7ba2d62
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/fluent/plugin/kubernetes_metadata_cache_strategy.rb
Expand Up @@ -30,8 +30,10 @@ def get_pod_metadata(key, namespace_name, pod_name, record_create_time, batch_mi
(m.nil? || m.empty?) ? {'pod_id'=>ids[:pod_id]} : m
end
metadata.merge!(@namespace_cache.fetch(ids[:namespace_id]) do
@stats.bump(:namespace_cache_miss)
m = fetch_namespace_metadata(namespace_name) unless @skip_namespace_metadata
m = unless @skip_namespace_metadata
@stats.bump(:namespace_cache_miss)
fetch_namespace_metadata(namespace_name)
end
(m.nil? || m.empty?) ? {'namespace_id'=>ids[:namespace_id]} : m
end)
else
Expand Down

0 comments on commit 7ba2d62

Please sign in to comment.