func FilterPluginsByKey(plugins []Plugin, key string) ([]Plugin, error) {
	name, ver := SplitKey(key)
	hasVersion := ver != ""
	var version Version
	if hasVersion {
		if err := version.Parse(ver); err != nil {
			return nil, err
		}
	}
	filtered := make([]Plugin, 0, len(plugins))
	for _, plugin := range plugins {
		if !strings.HasPrefix(plugin.Name(), name) {
			continue
		}
		if hasVersion && plugin.Version().Compare(version) != 0 {
			continue
		}
		filtered = append(filtered, plugin)
	}
	return filtered, nil
}
FilterPluginsByKey returns the set of plugins that match the provided key (may be not-fully qualified)
package plugin
import (
	"strings"
	"sigs.k8s.io/kubebuilder/v3/pkg/config"
)