func (f *Kustomization) GetCodeFragments() machinery.CodeFragmentsMap {
	const codeFragmentsLen = 3
	fragments := make(machinery.CodeFragmentsMap, codeFragmentsLen)
	res := make([]string, 0)
	res = append(res, fmt.Sprintf(resourceCodeFragment, f.Resource.QualifiedGroup(), f.Resource.Plural))
	webhookPatch := make([]string, 0)
	webhookPatch = append(webhookPatch, fmt.Sprintf(webhookPatchCodeFragment, f.Resource.Plural))
	caInjectionPatch := make([]string, 0)
	caInjectionPatch = append(caInjectionPatch, fmt.Sprintf(caInjectionPatchCodeFragment, f.Resource.Plural))
	if len(res) != 0 {
		fragments[machinery.NewMarkerFor(f.Path, resourceMarker)] = res
	}
	if len(webhookPatch) != 0 {
		fragments[machinery.NewMarkerFor(f.Path, webhookPatchMarker)] = webhookPatch
	}
	if len(caInjectionPatch) != 0 {
		fragments[machinery.NewMarkerFor(f.Path, caInjectionPatchMarker)] = caInjectionPatch
	}
	return fragments
}
GetCodeFragments implements file.Inserter.
package crd
import (
	"fmt"
	"path/filepath"
	"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
var (
	_ machinery.Template = &Kustomization{}
	_ machinery.Inserter = &Kustomization{}
)
type Kustomization struct {
	machinery.TemplateMixin
	machinery.ResourceMixin
}
func (f *Kustomization) SetTemplateDefaults() error {
	if f.Path == "" {
		f.Path = filepath.Join("config", "crd", "kustomization.yaml")
	}
	f.Path = f.Resource.Replacer().Replace(f.Path)
	f.TemplateBody = fmt.Sprintf(kustomizationTemplate,
		machinery.NewMarkerFor(f.Path, resourceMarker),
		machinery.NewMarkerFor(f.Path, webhookPatchMarker),
		machinery.NewMarkerFor(f.Path, caInjectionPatchMarker),
	)
	return nil
}
const (
	resourceMarker         = "crdkustomizeresource"
	webhookPatchMarker     = "crdkustomizewebhookpatch"
	caInjectionPatchMarker = "crdkustomizecainjectionpatch"
)
func (f *Kustomization) GetMarkers() []machinery.Marker {
	return []machinery.Marker{
		machinery.NewMarkerFor(f.Path, resourceMarker),
		machinery.NewMarkerFor(f.Path, webhookPatchMarker),
		machinery.NewMarkerFor(f.Path, caInjectionPatchMarker),
	}
}
const (
	resourceCodeFragment = `- bases/%s_%s.yaml
`
	webhookPatchCodeFragment = `#- patches/webhook_in_%s.yaml
`
	caInjectionPatchCodeFragment = `#- patches/cainjection_in_%s.yaml
`
)