realizer

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const PreviewCharacterLimit = 1024

Variables

This section is empty.

Functions

func NewContextGenerator added in v0.6.0

func NewContextGenerator(owner client.Object, ownerParams []v1alpha1.OwnerParam, blueprintParams []v1alpha1.BlueprintParam) *contextGenerator

Todo: Pass an interface for owner and ownerParams that supports getParams and getObject

func NewRealizer

func NewRealizer(healthyConditionEvaluator HealthyConditionEvaluator, mapper meta.RESTMapper) *realizer

Types

type ContextGenerator added in v0.6.0

type ContextGenerator interface {
	Generate(templateParams TemplateParams, resource OwnerResource, outputs OutputsGetter) map[string]interface{}
}

type HealthyConditionEvaluator added in v0.4.0

type HealthyConditionEvaluator func(rule *v1alpha1.HealthRule, realizedResource *v1alpha1.RealizedResource, stampedObject *unstructured.Unstructured) metav1.Condition

type InputGenerator added in v0.6.0

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

func NewInputGenerator added in v0.6.0

func NewInputGenerator(resource Resource, outputs OutputsGetter) *InputGenerator

func (*InputGenerator) GetConfigs added in v0.6.0

func (i *InputGenerator) GetConfigs() map[string]templates.ConfigInput

func (*InputGenerator) GetDeployment added in v0.6.0

func (i *InputGenerator) GetDeployment() *templates.SourceInput

func (*InputGenerator) GetImages added in v0.6.0

func (i *InputGenerator) GetImages() map[string]templates.ImageInput

func (*InputGenerator) GetSources added in v0.6.0

func (i *InputGenerator) GetSources() map[string]templates.SourceInput

type Outputs

type Outputs map[string]*templates.Output

func NewOutputs

func NewOutputs() Outputs

func (Outputs) AddOutput

func (o Outputs) AddOutput(resourceName string, output *templates.Output)

func (Outputs) GetConfig added in v0.6.0

func (o Outputs) GetConfig(resourceName string) templates.Config

func (Outputs) GetImage added in v0.6.0

func (o Outputs) GetImage(resourceName string) templates.Image

func (Outputs) GetSource added in v0.6.0

func (o Outputs) GetSource(resourceName string) *templates.Source

type OutputsGetter added in v0.6.0

type OutputsGetter interface {
	GetSource(resourceName string) *templates.Source
	GetImage(resourceName string) templates.Image
	GetConfig(resourceName string) templates.Config
}

type OwnerResource added in v0.4.0

type OwnerResource struct {
	TemplateRef     v1alpha1.TemplateReference
	TemplateOptions []v1alpha1.TemplateOption
	Params          []v1alpha1.BlueprintParam
	Name            string
	Sources         []v1alpha1.ResourceReference
	Images          []v1alpha1.ResourceReference
	Configs         []v1alpha1.ResourceReference
	Deployment      *v1alpha1.DeploymentReference
}

func MakeDeliveryOwnerResources added in v0.4.0

func MakeDeliveryOwnerResources(delivery *v1alpha1.ClusterDelivery) []OwnerResource

func MakeSupplychainOwnerResources added in v0.4.0

func MakeSupplychainOwnerResources(supplyChain *v1alpha1.ClusterSupplyChain) []OwnerResource

func (OwnerResource) GetConfigs added in v0.6.0

func (o OwnerResource) GetConfigs() []v1alpha1.ResourceReference

func (OwnerResource) GetDeployment added in v0.6.0

func (o OwnerResource) GetDeployment() *v1alpha1.DeploymentReference

func (OwnerResource) GetImages added in v0.6.0

func (o OwnerResource) GetImages() []v1alpha1.ResourceReference

func (OwnerResource) GetName added in v0.6.0

func (o OwnerResource) GetName() string

func (OwnerResource) GetSources added in v0.6.0

func (o OwnerResource) GetSources() []v1alpha1.ResourceReference

type ParamMerger added in v0.6.0

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

func NewParamMerger added in v0.6.0

func NewParamMerger(resourceParams []v1alpha1.BlueprintParam, blueprintParams []v1alpha1.BlueprintParam, ownerParams []v1alpha1.OwnerParam) *ParamMerger

func (ParamMerger) Merge added in v0.6.0

func (p ParamMerger) Merge(templateParams TemplateParams) map[string]apiextensionsv1.JSON

type Resource added in v0.6.0

type Resource interface {
	GetName() string
	GetSources() []v1alpha1.ResourceReference
	GetImages() []v1alpha1.ResourceReference
	GetConfigs() []v1alpha1.ResourceReference
	GetDeployment() *v1alpha1.DeploymentReference
}

type ResourceLabeler added in v0.4.0

type ResourceLabeler func(resource OwnerResource) templates.Labels

type ResourceRealizer added in v0.4.0

type ResourceRealizer interface {
	Do(ctx context.Context, resource OwnerResource, blueprintName string, outputs Outputs, mapper meta.RESTMapper) (templates.Reader, *unstructured.Unstructured, *templates.Output, bool, string, error)
}

type ResourceRealizerBuilder added in v0.4.0

type ResourceRealizerBuilder func(authToken string, owner client.Object, templatingContext ContextGenerator, systemRepo repository.Repository, resourceLabeler ResourceLabeler) (ResourceRealizer, error)

func NewResourceRealizerBuilder added in v0.4.0

func NewResourceRealizerBuilder(repositoryBuilder repository.RepositoryBuilder, clientBuilder realizerclient.ClientBuilder, cache repository.RepoCache) ResourceRealizerBuilder

type TemplateParams added in v0.6.0

type TemplateParams interface {
	GetDefaultParams() v1alpha1.TemplateParams
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.
gc
runnablefakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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