func (c cfg) GetResource(gvk resource.GVK) (resource.Resource, error) {
	for _, res := range c.Resources {
		if gvk.IsEqualTo(res.GVK) {
			r := res.Copy()
			if r.Plural == "" {
				r.Plural = resource.RegularPlural(r.Kind)
			}
			return r, nil
		}
	}
	return resource.Resource{}, config.ResourceNotFoundError{GVK: gvk}
}
GetResource implements config.Config
package v3
import (
	"fmt"
	"strings"
	"sigs.k8s.io/yaml"
	"sigs.k8s.io/kubebuilder/v3/pkg/config"
	"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
)
var Version = config.Version{Number: 3}
type stringSlice []string
func (ss *stringSlice) UnmarshalJSON(b []byte) error {
	if b[0] == '[' {
		var sl []string
		if err := yaml.Unmarshal(b, &sl); err != nil {
			return err
		}
		*ss = sl
		return nil
	}
	var st string
	if err := yaml.Unmarshal(b, &st); err != nil {
		return err
	}
	*ss = stringSlice{st}
	return nil
}
type cfg struct {
	Version config.Version `json:"version"`
	Domain      string      `json:"domain,omitempty"`
	Repository  string      `json:"repo,omitempty"`
	Name        string      `json:"projectName,omitempty"`
	PluginChain stringSlice `json:"layout,omitempty"`
	MultiGroup      bool `json:"multigroup,omitempty"`
	ComponentConfig bool `json:"componentConfig,omitempty"`
	Resources []resource.Resource `json:"resources,omitempty"`
	Plugins pluginConfigs `json:"plugins,omitempty"`
}
type pluginConfigs map[string]pluginConfig
type pluginConfig interface{}
func New() config.Config {
	return &cfg{Version: Version}
}
func init() {
	config.Register(Version, New)
}
func (c cfg) GetVersion() config.Version {
	return c.Version
}
func (c cfg) GetDomain() string {
	return c.Domain
}
func (c *cfg) SetDomain(domain string) error {
	c.Domain = domain
	return nil
}
func (c cfg) GetRepository() string {
	return c.Repository
}
func (c *cfg) SetRepository(repository string) error {
	c.Repository = repository
	return nil
}
func (c cfg) GetProjectName() string {
	return c.Name
}
func (c *cfg) SetProjectName(name string) error {
	c.Name = name
	return nil
}
func (c cfg) GetPluginChain() []string {
	return c.PluginChain
}
func (c *cfg) SetPluginChain(pluginChain []string) error {
	c.PluginChain = pluginChain
	return nil
}
func (c cfg) IsMultiGroup() bool {
	return c.MultiGroup
}
func (c *cfg) SetMultiGroup() error {
	c.MultiGroup = true
	return nil
}
func (c *cfg) ClearMultiGroup() error {
	c.MultiGroup = false
	return nil
}
func (c cfg) IsComponentConfig() bool {
	return c.ComponentConfig
}
func (c *cfg) SetComponentConfig() error {
	c.ComponentConfig = true
	return nil
}
func (c *cfg) ClearComponentConfig() error {
	c.ComponentConfig = false
	return nil
}
func (c cfg) ResourcesLength() int {
	return len(c.Resources)
}
func (c cfg) HasResource(gvk resource.GVK) bool {
	for _, res := range c.Resources {
		if gvk.IsEqualTo(res.GVK) {
			return true
		}
	}
	return false
}