From 5142f593d3f03c3ffd39392ec0866a9e0638a006 Mon Sep 17 00:00:00 2001 From: Shizuo Fujita Date: Wed, 24 Jun 2026 03:11:16 +0000 Subject: [PATCH 1/2] Disable rubocop's Naming/PredicateMethod check Disable check to suppress errors since no alternative exists --- test/plugin/test_cache_strategy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/plugin/test_cache_strategy.rb b/test/plugin/test_cache_strategy.rb index 5f99ef9..028b676 100644 --- a/test/plugin/test_cache_strategy.rb +++ b/test/plugin/test_cache_strategy.rb @@ -46,7 +46,7 @@ def fetch_namespace_metadata(_namespace_name) def log logger = {} - def logger.on_trace + def logger.on_trace # rubocop:disable Naming/PredicateMethod true end From c2606645b50f0b92a84152f60cc0fd46448cf2aa Mon Sep 17 00:00:00 2001 From: Shizuo Fujita Date: Wed, 24 Jun 2026 04:24:59 +0000 Subject: [PATCH 2/2] Use FileUtils.touch instead to fix rubocop error Fix Style/FileOpen error, this will solve file descriptor leaks. --- test/plugin/test_filter_kubernetes_metadata.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/plugin/test_filter_kubernetes_metadata.rb b/test/plugin/test_filter_kubernetes_metadata.rb index 0b0b7c9..93005e5 100644 --- a/test/plugin/test_filter_kubernetes_metadata.rb +++ b/test/plugin/test_filter_kubernetes_metadata.rb @@ -117,8 +117,8 @@ def create_driver(conf = '') expected_cert_path = File.join(dir, Plugin::KubernetesMetadataFilter::K8_POD_CA_CERT) expected_token_path = File.join(dir, Plugin::KubernetesMetadataFilter::K8_POD_TOKEN) - File.open(expected_cert_path, 'w') - File.open(expected_token_path, 'w') + FileUtils.touch(expected_cert_path) + FileUtils.touch(expected_token_path) d = create_driver(" watch false