Skip to content

Commit

Permalink
checkconfig: fix plugin name in verifyLabelPlugin
Browse files Browse the repository at this point in the history
Name of the plugin in the message was wrong, fix it. Export the plugin
name for that purpose.
  • Loading branch information
petr-muller committed Nov 4, 2021
1 parent 24d8031 commit bd38ac8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion prow/cmd/checkconfig/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import (
"k8s.io/test-infra/prow/plugins/bugzilla"
"k8s.io/test-infra/prow/plugins/cherrypickunapproved"
"k8s.io/test-infra/prow/plugins/hold"
labelplugin "k8s.io/test-infra/prow/plugins/label"
"k8s.io/test-infra/prow/plugins/lgtm"
ownerslabel "k8s.io/test-infra/prow/plugins/owners-label"
"k8s.io/test-infra/prow/plugins/releasenote"
Expand Down Expand Up @@ -1064,7 +1065,7 @@ func verifyLabelPlugin(label plugins.Label) error {
if len(orgRepos) > 0 {
sort.Strings(orgRepos)
return fmt.Errorf("the following orgs or repos have configuration of %s plugin using the empty string as label name in restricted labels: %s",
verifyowners.PluginName, strings.Join(orgRepos, ", "),
labelplugin.PluginName, strings.Join(orgRepos, ", "),
)
}
return nil
Expand Down
8 changes: 5 additions & 3 deletions prow/plugins/label/label.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ import (
"k8s.io/test-infra/prow/plugins"
)

const pluginName = "label"
const (
PluginName = "label"
)

var (
defaultLabels = []string{"kind", "priority", "area"}
Expand All @@ -43,7 +45,7 @@ var (
)

func init() {
plugins.RegisterGenericCommentHandler(pluginName, handleGenericComment, helpProvider)
plugins.RegisterGenericCommentHandler(PluginName, handleGenericComment, helpProvider)
}

func configString(labels []string) string {
Expand All @@ -64,7 +66,7 @@ func helpProvider(config *plugins.Configuration, _ []config.OrgRepo) (*pluginhel
},
})
if err != nil {
logrus.WithError(err).Warnf("cannot generate comments for %s plugin", pluginName)
logrus.WithError(err).Warnf("cannot generate comments for %s plugin", PluginName)
}
pluginHelp := &pluginhelp.PluginHelp{
Description: "The label plugin provides commands that add or remove certain types of labels. Labels of the following types can be manipulated: 'area/*', 'committee/*', 'kind/*', 'language/*', 'priority/*', 'sig/*', 'triage/*', and 'wg/*'. More labels can be configured to be used via the /label command.",
Expand Down

0 comments on commit bd38ac8

Please sign in to comment.