Skip to content

Commit

Permalink
Central Repo: Only sync plugins from context
Browse files Browse the repository at this point in the history
For the Central Repository feature, we no longer sync standalone plugins
but only plugins "recommended" by the context.

Signed-off-by: Marc Khouzam <kmarc@vmware.com>
  • Loading branch information
marckhouzam committed Feb 1, 2023
1 parent 1b131bc commit 54e2364
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pkg/pluginmanager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,10 +681,19 @@ func DeletePlugin(options DeletePluginOptions) error {
return nil
}

// SyncPlugins automatically downloads all available plugins to users machine
// SyncPlugins automatically installs all plugins of the current contexts
func SyncPlugins() error {
log.Info("Checking for required plugins...")
plugins, err := AvailablePlugins()
var plugins []discovery.Discovered
var err error
if configlib.IsFeatureActivated(constants.FeatureCentralRepository) {
plugins, err = DiscoverServerPlugins()
if installedPlugins, err := pluginsupplier.GetInstalledServerPlugins(); err == nil {
setAvailablePluginsStatus(plugins, installedPlugins)
}
} else {
plugins, err = AvailablePlugins()
}
if err != nil {
return err
}
Expand Down

0 comments on commit 54e2364

Please sign in to comment.