func (r *ResourceRegistrationFile) createGetKnownStorageTypesFunc(codeGenerationContext *astmodel.CodeGenerationContext) (dst.Decl, error) {
	return createKnownTypesFuncImpl(
		codeGenerationContext,
		r.storageVersionResources,
		"getKnownStorageTypes",
		"returns the list of storage types which can be reconciled.")
}
createGetKnownStorageTypesFunc creates a getKnownStorageTypes function that returns all storage types:
func getKnownStorageTypes() []runtime.Object {
var result []runtime.Object
result = append(result, new(<package>.<resource>))
result = append(result, new(<package>.<resource>))
result = append(result, new(<package>.<resource>))
...
return result
}
package codegen
import (
	"go/token"
	"sort"
	"github.com/dave/dst"
	"github.com/Azure/k8s-infra/hack/generator/pkg/astbuilder"
	"github.com/Azure/k8s-infra/hack/generator/pkg/astmodel"
)
type ResourceRegistrationFile struct {
	resources               []astmodel.TypeName
	storageVersionResources []astmodel.TypeName
}
var _ astmodel.GoSourceFile = &ResourceRegistrationFile{}
func NewResourceRegistrationFile(resources []astmodel.TypeName, storageVersionResources []astmodel.TypeName) *ResourceRegistrationFile {
	return &ResourceRegistrationFile{
		resources:               resources,
		storageVersionResources: storageVersionResources,
	}
}
func (r *ResourceRegistrationFile) AsAst() (*dst.File, error) {
	var decls []dst.Decl
	packageReferences := r.generateImports()
	codeGenContext := astmodel.NewCodeGenerationContext(
		astmodel.MakeExternalPackageReference("controllers"),  
		packageReferences,
		nil)
	thing := packageReferences.AsImportSpecs()
	if packageReferences.Length() > 0 {
		decls = append(decls, &dst.GenDecl{
			Decs: dst.GenDeclDecorations{
				NodeDecs: dst.NodeDecs{
					After: dst.EmptyLine,
				},
			},
			Tok:   token.IMPORT,
			Specs: thing,
		})
	}
	knownStorageTypes, err := r.createGetKnownStorageTypesFunc(codeGenContext)
	if err != nil {
		return nil, err
	}
	decls = append(decls, knownStorageTypes)
	knownTypes, err := r.createGetKnownTypesFunc(codeGenContext)
	if err != nil {
		return nil, err
	}
	decls = append(decls, knownTypes)
	createSchemeFunc, err := r.createCreateSchemeFunc(codeGenContext)
	if err != nil {
		return nil, err
	}
	decls = append(decls, createSchemeFunc)
	var header []string
	header = append(header, astmodel.CodeGenerationComments...)
	header = append(header,
		"// Copyright (c) Microsoft Corporation.",
		"// Licensed under the MIT license.")
	result := &dst.File{
		Decs: dst.FileDecorations{
			NodeDecs: dst.NodeDecs{
				Start: header,
				After: dst.EmptyLine,
			},
		},
		Name:  dst.NewIdent("controllers"),  
		Decls: decls,
	}
	return result, nil
}
func (r *ResourceRegistrationFile) generateImports() *astmodel.PackageImportSet {
	requiredImports := astmodel.NewPackageImportSet()
	for _, typeName := range append(r.resources, r.storageVersionResources...) {
		imp := astmodel.NewPackageImport(typeName.PackageReference)
		imp = imp.WithName(imp.VersionedNameForImport())
		requiredImports.AddImport(imp)
	}
	clientGoSchemePkgRef := makeClientGoKubernetesSchemePackageReference()
	clientGoSchemeImport := astmodel.NewPackageImport(clientGoSchemePkgRef).WithName("clientgoscheme")
	requiredImports.AddImport(clientGoSchemeImport)
	runtimeImport := astmodel.NewPackageImport(makeApiMachineryRuntimePackageReference())
	requiredImports.AddImport(runtimeImport)
	return requiredImports
}
func makeApiMachineryRuntimePackageReference() astmodel.PackageReference {
	return astmodel.MakeExternalPackageReference("k8s.io/apimachinery/pkg/runtime")
}
func makeClientGoKubernetesSchemePackageReference() astmodel.PackageReference {
	return astmodel.MakeExternalPackageReference("k8s.io/client-go/kubernetes/scheme")
}