From 7278b9b3d8fd0c3600722e478e7760a95489c5cd Mon Sep 17 00:00:00 2001 From: Pradithya Aria Date: Wed, 2 Oct 2024 18:04:51 +0800 Subject: [PATCH 1/2] fix: fix false positive in plugin application discovery Signed-off-by: Pradithya Aria --- util/app/discovery/discovery.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/app/discovery/discovery.go b/util/app/discovery/discovery.go index df80e3bf987c2..d839b15c866f6 100644 --- a/util/app/discovery/discovery.go +++ b/util/app/discovery/discovery.go @@ -174,7 +174,7 @@ func cmpSupports(ctx context.Context, pluginSockFilePath, appPath, repoPath, fil } // if discovery is not configured, return the client without further checks - if !cfg.IsDiscoveryConfigured { + if !cfg.IsDiscoveryConfigured && namedPlugin { return conn, cmpClient, true } From 3f3aec77ff904757b566939d1b30cf3454304c44 Mon Sep 17 00:00:00 2001 From: Pradithya Aria Date: Thu, 3 Oct 2024 23:06:07 +0800 Subject: [PATCH 2/2] fix: apply suggestion to return immediately if discovery is not configured for unnamed plugin Signed-off-by: Pradithya Aria --- util/app/discovery/discovery.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/util/app/discovery/discovery.go b/util/app/discovery/discovery.go index d839b15c866f6..580e4cd06935d 100644 --- a/util/app/discovery/discovery.go +++ b/util/app/discovery/discovery.go @@ -173,9 +173,12 @@ func cmpSupports(ctx context.Context, pluginSockFilePath, appPath, repoPath, fil return nil, nil, false } - // if discovery is not configured, return the client without further checks - if !cfg.IsDiscoveryConfigured && namedPlugin { - return conn, cmpClient, true + if !cfg.IsDiscoveryConfigured { + // If discovery isn't configured but the plugin is named, then the plugin supports the repo. + if namedPlugin { + return conn, cmpClient, true + } + return nil, nil, false } isSupported, isDiscoveryEnabled, err := matchRepositoryCMP(ctx, appPath, repoPath, cmpClient, env, tarExcludedGlobs)