Skip to content

Commit

Permalink
Merge pull request #1487 from FabianKramm/main
Browse files Browse the repository at this point in the history
fix: plugin v2 hooks
  • Loading branch information
FabianKramm committed Jan 30, 2024
2 parents 8e72b5d + baae75d commit acd9c71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions pkg/plugin/v2/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ func (m *Manager) Start(
if err != nil {
return fmt.Errorf("error adding client hook for plugin %s: %w", vClusterPlugin.Path, err)
}

klog.FromContext(ctx).Info("Successfully loaded plugin", "plugin", vClusterPlugin.Path)
}

return nil
Expand Down
8 changes: 4 additions & 4 deletions pkg/util/pluginhookclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ func NewVirtualPluginClientFactory(delegate client.NewClientFunc) client.NewClie
}

func NewPluginClient(virtual bool, delegate client.NewClientFunc) client.NewClientFunc {
if !plugin.DefaultManager.HasPlugins() {
return delegate
}

return func(config *rest.Config, options client.Options) (client.Client, error) {
if !plugin.DefaultManager.HasPlugins() {
return delegate(config, options)
}

innerClient, err := delegate(config, options)
if err != nil {
return nil, err
Expand Down

0 comments on commit acd9c71

Please sign in to comment.