• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kubernetes-sigs / kubebuilder / 21778493952

07 Feb 2026 10:13AM UTC coverage: 73.863% (-0.09%) from 73.954%
21778493952

Pull #5448

github

camilamacedo86
fix(CLI/API) prevent --help from being validated as plugin name

- Add PersistentPreRunE hook to detect help flags in plugin values
- Filter help flags before plugin validation
- Show plugin descriptions instead of project versions
- Use short plugin keys (go/v4 vs go.kubebuilder.io/v4)
- Filter plugins by subcommand (init/edit/create)
- Hide deprecated plugins from help output
- Add documentation links for each plugin
- Improve root help wording for better getting-started experience

Generate-by: Cursour/Claude
Pull Request #5448: 🐛 fix(CLI/API) prevent --help from being validated as plugin name

174 of 227 new or added lines in 15 files covered. (76.65%)

1 existing line in 1 file now uncovered.

6887 of 9324 relevant lines covered (73.86%)

43.55 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

35.71
/pkg/plugins/common/kustomize/v2/plugin.go
1
/*
2
Copyright 2022 The Kubernetes Authors.
3

4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7

8
    http://www.apache.org/licenses/LICENSE-2.0
9

10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
*/
16

17
package v2
18

19
import (
20
        "sigs.k8s.io/kubebuilder/v4/pkg/config"
21
        cfgv3 "sigs.k8s.io/kubebuilder/v4/pkg/config/v3"
22
        "sigs.k8s.io/kubebuilder/v4/pkg/model/stage"
23
        "sigs.k8s.io/kubebuilder/v4/pkg/plugin"
24
        "sigs.k8s.io/kubebuilder/v4/pkg/plugins"
25
)
26

27
// KustomizeVersion is the kubernetes-sigs/kustomize version to be used in the project
28
const KustomizeVersion = "v5.8.0"
29

30
const pluginName = "kustomize.common." + plugins.DefaultNameQualifier
31

32
var (
33
        pluginVersion            = plugin.Version{Number: 2, Stage: stage.Stable}
34
        supportedProjectVersions = []config.Version{cfgv3.Version}
35
)
36

37
var (
38
        _ plugin.Init          = Plugin{}
39
        _ plugin.CreateAPI     = Plugin{}
40
        _ plugin.CreateWebhook = Plugin{}
41
)
42

43
// Plugin implements the plugin.Full interface
44
type Plugin struct {
45
        initSubcommand
46
        createAPISubcommand
47
        createWebhookSubcommand
48
}
49

50
// Name returns the name of the plugin
51
func (Plugin) Name() string { return pluginName }
×
52

53
// Version returns the version of the plugin
54
func (Plugin) Version() plugin.Version { return pluginVersion }
1✔
55

56
// SupportedProjectVersions returns an array with all project versions supported by the plugin
57
func (Plugin) SupportedProjectVersions() []config.Version { return supportedProjectVersions }
1✔
58

59
// GetInitSubcommand will return the subcommand which is responsible for scaffolding init project
60
func (p Plugin) GetInitSubcommand() plugin.InitSubcommand { return &p.initSubcommand }
×
61

62
// GetCreateAPISubcommand will return the subcommand which is responsible for scaffolding apis
63
func (p Plugin) GetCreateAPISubcommand() plugin.CreateAPISubcommand { return &p.createAPISubcommand }
×
64

65
// GetCreateWebhookSubcommand will return the subcommand which is responsible for scaffolding webhooks
66
func (p Plugin) GetCreateWebhookSubcommand() plugin.CreateWebhookSubcommand {
×
67
        return &p.createWebhookSubcommand
×
68
}
×
69

70
// Description returns a short description of the plugin
NEW
71
func (Plugin) Description() string {
×
NEW
72
        return "Scaffold Kustomize config/"
×
NEW
73
}
×
74

75
// DeprecationWarning define the deprecation message or return empty when plugin is not deprecated
76
func (p Plugin) DeprecationWarning() string {
1✔
77
        return ""
1✔
78
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc