Skip to content

Commit

Permalink
fix: Fix false positive in plugin application discovery (#20196)
Browse files Browse the repository at this point in the history
* fix: fix false positive in plugin application discovery

Signed-off-by: Pradithya Aria <[email protected]>

* fix: apply suggestion to return immediately if discovery is not configured for unnamed plugin

Signed-off-by: Pradithya Aria <[email protected]>

---------

Signed-off-by: Pradithya Aria <[email protected]>
  • Loading branch information
pradithya authored Oct 3, 2024
1 parent 5f8de97 commit b2091e3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions util/app/discovery/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
return conn, cmpClient, true
// 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)
Expand Down

0 comments on commit b2091e3

Please sign in to comment.