pipeline

package
v2.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2025 License: Apache-2.0 Imports: 23 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// GenStatement is printed on every generated file.
	GenStatement = "// Code generated by upjet. DO NOT EDIT."
)

Variables

This section is empty.

Functions

func Run

func Run(pcCluster, pcNamespace *config.Provider, rootDir string)

Run runs the Upjet code generation pipelines, using the given provider configurations for cluster scoped and namespaced resources. The provider configuration for namespaced resources is optional, if it isn't provided then this function will only generate cluster scoped resources.

Types

type CRDGenerator

type CRDGenerator struct {
	LocalDirectoryPath string
	Group              string
	Scope              tjtypes.CRDScope
	ProviderShortName  string
	LicenseHeaderPath  string
	Generated          *tjtypes.Generated
	// contains filtered or unexported fields
}

CRDGenerator takes certain information referencing Terraform resource definition and writes kubebuilder CRD file.

func NewCRDGenerator

func NewCRDGenerator(pkg *types.Package, apiDir, hackDir, providerShortName, group, version string, scope tjtypes.CRDScope) *CRDGenerator

NewCRDGenerator returns a new CRDGenerator.

func (*CRDGenerator) Generate

func (cg *CRDGenerator) Generate(cfg *config.Resource) (string, error)

Generate builds and writes a new CRD out of Terraform resource definition.

type ControllerGenerator

type ControllerGenerator struct {
	Group              string
	ControllerGroupDir string
	ModulePath         string
	LicenseHeaderPath  string
}

ControllerGenerator generates controller setup functions.

func NewControllerGenerator

func NewControllerGenerator(ctrlDir, hackDir, ctrlModulePath, group string) *ControllerGenerator

NewControllerGenerator returns a new ControllerGenerator.

func (*ControllerGenerator) Generate

func (cg *ControllerGenerator) Generate(cfg *config.Resource, typesPkgPath string, featuresPkgPath string) (pkgPath string, err error)

Generate writes controller setup functions.

type ConversionNodeGenerator

type ConversionNodeGenerator struct {
	// contains filtered or unexported fields
}

ConversionNodeGenerator generates conversion methods implementing the conversion.Convertible interface on the CRD structs.

func NewConversionNodeGenerator

func NewConversionNodeGenerator(apiDir, hackDir, apiModulePath, group, generatedFileName, fileTemplate string, p generationPredicate) *ConversionNodeGenerator

NewConversionNodeGenerator returns a new ConversionNodeGenerator.

func (*ConversionNodeGenerator) Generate

func (cg *ConversionNodeGenerator) Generate(versionMap map[string]map[string]*config.Resource) error

Generate writes generated conversion.Convertible interface functions

type MainGenerator

type MainGenerator struct {
	ProviderPath string
	Template     string
}

func NewMainGenerator

func NewMainGenerator(cmdDir, template string) *MainGenerator

func (*MainGenerator) Generate

func (mg *MainGenerator) Generate(groups []string) error

Generate writes the setup file given list of version packages.

type PipelineRunner

type PipelineRunner struct {
	DirAPIs        string
	DirControllers string
	DirExamples    string
	DirHack        string

	ModulePathAPIs        string
	ModulePathControllers string

	Scope tjtypes.CRDScope
}

func (*PipelineRunner) Run

func (r *PipelineRunner) Run(pc *config.Provider) []string

type RegisterGenerator

type RegisterGenerator struct {
	LocalDirectoryPath string
	ModulePath         string
	LicenseHeaderPath  string
}

RegisterGenerator generates scheme registration file.

func NewRegisterGenerator

func NewRegisterGenerator(apiDir, hackDir, apiModulePath string) *RegisterGenerator

NewRegisterGenerator returns a new RegisterGenerator.

func (*RegisterGenerator) Generate

func (rg *RegisterGenerator) Generate(versionPkgList []string) error

Generate writes the register file with the content produced using given list of version packages.

type SetupGenerator

type SetupGenerator struct {
	LocalDirectoryPath string
	LicenseHeaderPath  string
	ModulePath         string
}

SetupGenerator generates controller setup file.

func NewSetupGenerator

func NewSetupGenerator(ctrlDir, hackDir, apiModulePath string) *SetupGenerator

NewSetupGenerator returns a new generator that sets up controllers.

func (*SetupGenerator) Generate

func (sg *SetupGenerator) Generate(versionPkgMap map[string][]string, monolith bool) error

Generate writes the setup file given list of version packages.

type TerraformedGenerator

type TerraformedGenerator struct {
	LocalDirectoryPath string
	LicenseHeaderPath  string
	// contains filtered or unexported fields
}

TerraformedGenerator generates conversion methods implementing Terraformed interface on CRD structs.

func NewTerraformedGenerator

func NewTerraformedGenerator(pkg *types.Package, apiDir, hackDir, group, version string) *TerraformedGenerator

NewTerraformedGenerator returns a new TerraformedGenerator.

func (*TerraformedGenerator) Generate

func (tg *TerraformedGenerator) Generate(cfgs []*terraformedInput, apiVersion string) error

Generate writes generated Terraformed interface functions

type VersionGenerator

type VersionGenerator struct {
	Group             string
	Version           string
	DirectoryPath     string
	LicenseHeaderPath string
	// contains filtered or unexported fields
}

VersionGenerator generates files for a version of a specific group.

func NewVersionGenerator

func NewVersionGenerator(apiDir, hackDir, apisModulePath, group, version string) *VersionGenerator

NewVersionGenerator returns a new VersionGenerator.

func (*VersionGenerator) Generate

func (vg *VersionGenerator) Generate() error

Generate writes doc and group version info files to the disk.

func (*VersionGenerator) InsertPreviousObjects

func (vg *VersionGenerator) InsertPreviousObjects(versions map[string]map[string]*config.Resource) error

InsertPreviousObjects inserts into this VersionGenerator's package scope all the type definitions from the previous versions of the managed resource APIs found in the Go package.

func (*VersionGenerator) Package

func (vg *VersionGenerator) Package() *types.Package

Package returns the package of the version that will be generated.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL