Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/cli/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ func DiscoverExternalPlugins(filesystem afero.Fs) (ps []plugin.Plugin, err error
return nil, fmt.Errorf("error parsing external plugin version %q: %w", version.Name(), err)
}

slog.Info("Adding external plugin", "plugin name", ep.Name())
slog.Debug("Adding external plugin", "plugin name", ep.Name())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if when we run any command if we have plugins, external plugins we be aware of.
The external plugins change the behaviour so it is important we know what.

How we could do that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think every command should display that info.

For example, the current implementation logs that info for commands like version and help, (and it affects piping commands into others, since it alters the output of the command):

$ kubebuilder help
INFO Adding external plugin plugin name=foo.acme.io   <----------------
CLI tool for building Kubernetes extensions and tools.

Usage:
  kubebuilder [flags]
  kubebuilder [command]
$ kubebuilder version
INFO Adding external plugin plugin name=foo.acme.io  <--------------------
KubeBuilder:          v4.13.2-0.20260410132500-9eaff61e4d5a
Kubernetes:           1.35.0
Git Commit:           9eaff61e4d5a861e56f42bc054cfc93038a09058
Build Date:           2026-04-10T13:25:00Z
Go OS/Arch:           linux/amd64

IMO if plugins should be installed and explicitly informed by the user in order to be used (they are not set on by default) and the flags that they support are clearly labeled in completion, the users are aware of the plugin's existence and what are its capabilities and we wouldn't need to log that info:

$ kubebuilder edit --plugins 
^[[36mINFO^[[0m Adding external plugin plugin name=foo.acme.io
autoupdate.kubebuilder.io/v1-alpha                            (Proposes Kubebuilder scaffold updates via GitHub Actions)
base.go.kubebuilder.io/v4                                     (Default scaffold (go/v4 + kustomize/v2))
deploy-image.go.kubebuilder.io/v1-alpha                       (Scaffolds a CRD+controller to deploy an image-based Operand)
foo.acme.io/v2            <-----------                        (External or custom plugin)
go.kubebuilder.io/v4                                          (Default scaffold (go/v4 + kustomize/v2))
grafana.kubebuilder.io/v1-alpha                               (Generates Grafana Dashboards for metrics)
helm.kubebuilder.io/v2-alpha                                  (Generates a Helm chart for project distribution)
kustomize.common.kubebuilder.io/v2                            (Scaffolds base Kustomize configuration)
$ kubebuilder edit --plugins foo.acme.io --
--  -----> (For plugin (foo.acme.io/v2): Kubebuilder could not validate this flag with the external plugin. Consult the external plugin documentation for more information.)
--help     (help for edit)
--plugins  (plugin keys to be used for this subcommand execution)
$ kubebuilder edit --plugins foo.acme.io/v2 --plugins autoupdate.kubebuilder.io/v1-alpha --
--      -------->  (For plugin (foo.acme.io/v2): Kubebuilder could not validate this flag with the external plugin. Consult the external plugin documentation for more information.)
--help             (help for init)
--plugins          (plugin keys to be used for this subcommand execution)
--project-version  (project version)
--use-gh-models    (For plugin (autoupdate.kubebuilder.io/v1-alpha): enable GitHub Models AI summary in the scaffolded workflow (requires GitHub Models permissions))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think today is really bad.

But external plugins are called in the chain of all commands. (if used)
So, we probably need to find a nice way to inform that.


ps = append(ps, ep)
}
Expand Down