generator

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateReleaseName

func GenerateReleaseName(componentName string, date time.Time, version string, index *fsmode.Index) (string, error)

GenerateReleaseName generates a release name following the naming convention Format: <component-name>-<YYYYMMDD>-<version>

func IncrementVersion

func IncrementVersion(version string) string

IncrementVersion parses a version string and returns the next version

func ParseReleaseName

func ParseReleaseName(releaseName string) (componentName, dateStr, version string, err error)

ParseReleaseName extracts component name, date, and version from a release name Returns component name, date string, version, and error if parsing fails

Types

type BindingError

type BindingError struct {
	ProjectName   string
	ComponentName string
	Error         error
}

BindingError contains error information for a failed binding

type BindingGenerator

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

BindingGenerator generates ReleaseBinding resources

func NewBindingGenerator

func NewBindingGenerator(index *fsmode.Index) *BindingGenerator

NewBindingGenerator creates a new binding generator

func (*BindingGenerator) GenerateBinding

func (g *BindingGenerator) GenerateBinding(opts BindingOptions) (*unstructured.Unstructured, error)

GenerateBinding generates a single ReleaseBinding

func (*BindingGenerator) GenerateBindingWithInfo added in v0.15.0

func (g *BindingGenerator) GenerateBindingWithInfo(opts BindingOptions) (*BindingInfo, error)

GenerateBindingWithInfo generates a single ReleaseBinding and returns rich info including whether this is an update and the existing file path.

func (*BindingGenerator) GenerateBulkBindings

func (g *BindingGenerator) GenerateBulkBindings(opts BulkBindingOptions) (*BulkBindingResult, error)

GenerateBulkBindings generates bindings for multiple components

type BindingInfo

type BindingInfo struct {
	BindingName      string
	ProjectName      string
	ComponentName    string
	ReleaseName      string
	Environment      string
	Binding          *unstructured.Unstructured
	IsUpdate         bool   // true if updating existing binding, false if creating new
	ExistingFilePath string // original file path when IsUpdate is true
}

BindingInfo contains information about a generated binding

type BindingOptions

type BindingOptions struct {
	ProjectName      string
	ComponentName    string
	ComponentRelease string // If empty, auto-select based on environment position
	TargetEnv        string
	PipelineInfo     *pipeline.PipelineInfo
	Namespace        string
}

BindingOptions defines options for generating a single binding

type BulkBindingOptions

type BulkBindingOptions struct {
	All          bool
	ProjectName  string
	TargetEnv    string
	PipelineInfo *pipeline.PipelineInfo
	Namespace    string
}

BulkBindingOptions defines options for bulk binding generation

type BulkBindingResult

type BulkBindingResult struct {
	Bindings []BindingInfo
	Errors   []BindingError
}

BulkBindingResult contains the results of bulk binding generation

type BulkReleaseOptions

type BulkReleaseOptions struct {
	ProjectName string // If set, only release components in this project
	All         bool   // If true, release all components
	Version     string // Version string for all releases
	Namespace   string // Kubernetes namespace
}

BulkReleaseOptions configures bulk release generation

type BulkReleaseResult

type BulkReleaseResult struct {
	Releases []ReleaseInfo
	Errors   []ReleaseError
}

BulkReleaseResult represents the result of a bulk release operation

type ReleaseError

type ReleaseError struct {
	ComponentName string
	ProjectName   string
	Error         error
}

ReleaseError contains info about a failed release

type ReleaseGenerator

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

ReleaseGenerator generates ComponentRelease resources

func NewReleaseGenerator

func NewReleaseGenerator(index *fsmode.Index) *ReleaseGenerator

NewReleaseGenerator creates a new release generator

func (*ReleaseGenerator) GenerateBulkReleases

func (g *ReleaseGenerator) GenerateBulkReleases(opts BulkReleaseOptions) (*BulkReleaseResult, error)

GenerateBulkReleases generates releases for multiple components

func (*ReleaseGenerator) GenerateRelease

func (g *ReleaseGenerator) GenerateRelease(opts ReleaseOptions) (*unstructured.Unstructured, error)

GenerateRelease generates a ComponentRelease for the specified component. It resolves the component, its ComponentType (or ClusterComponentType), the referenced traits, and the workload, then delegates spec assembly to componentrelease.BuildSpec so that filesystem mode produces the same ComponentReleaseSpec as the controller and API server.

type ReleaseInfo

type ReleaseInfo struct {
	ComponentName string
	ProjectName   string
	ReleaseName   string
	Release       *unstructured.Unstructured
}

ReleaseInfo contains info about a generated release

type ReleaseOptions

type ReleaseOptions struct {
	ComponentName string
	ProjectName   string
	Namespace     string
	ReleaseName   string    // Optional: custom release name (if empty, auto-generated from component, date, version)
	Version       string    // Optional: auto-generated if empty
	Date          time.Time // Optional: uses current date if zero
}

ReleaseOptions configures release generation

Jump to

Keyboard shortcuts

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