-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance CMP Plugin Evaluation for Applications with Name-based Configuration #17948
Comments
If it is ok, I can create the MR :) |
Moving the discussion and current conclusions from #18053 for visibility Makes more sense provide a new pre-flight operation to check the plugin configuration (and check if discovery is enabled or not) plugin.proto message CheckPluginConfigurationResponse {
bool isDiscoveryConfigured = 1;
}
...
// CheckPluginConfiguration is a pre-flight request to check the plugin configuration
// without sending the whole repo.
rpc CheckPluginConfiguration(stream AppStreamRequest) returns (CheckPluginConfigurationResponse) {
} In that case plugin.go type CheckPluginConfigurationStream interface {
Stream
SendAndClose(response *apiclient.CheckPluginConfigurationResponse) error
}
func (s *Service) CheckPluginConfiguration(stream apiclient.ConfigManagementPluginService_CheckPluginConfigurationServer) error {
return s.checkPluginConfigurationGeneric(stream)
}
func (s *Service) checkPluginConfigurationGeneric(stream CheckPluginConfigurationStream) error {
isDiscoveryConfigured := s.isDiscoveryConfigured()
repoResponse := &apiclient.CheckPluginConfigurationResponse{IsDiscoveryConfigured: isDiscoveryConfigured}
err := stream.SendAndClose(repoResponse)
if err != nil {
return fmt.Errorf("error sending check plugin configuration response: %w", err)
}
return nil
}
func (s *Service) isDiscoveryConfigured() (IsDiscoveryConfigured bool) {
config := s.initConstants.PluginConfig
return config.Spec.Discover.FileName != "" || config.Spec.Discover.Find.Glob != "" || len(config.Spec.Discover.Find.Command.Command) > 0
} |
Summary
Modify the behavior during cmp plugin evaluation (
DetectConfigManagementPlugin
) to avoid transferring the entire repository tocmp-server
when the application configures the plugin by name.Motivation
In scenarios involving monorepos and/or multiple clusters, transferring the entire repository multiple times solely for verifying the correct configuration of the plugin can lead to disk usage bottlenecks impacting performance and resource utilization:
Proposal
Instead of transferring the entire repository during plugin evaluation, consider adjusting the implementation to return the client (cmpClient) without performing a
matchRepository
operation when the application'plugin be configured by its.utils/app/discovery/discovery.go
The text was updated successfully, but these errors were encountered: