render

package
v0.93.4 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const KubernetesObjectsKind = "KubernetesObjects"

Variables

This section is empty.

Functions

func Platform

func Platform(ctx context.Context, concurrency int, pf *core.Platform, stderr io.Writer) error

Types

type HelmChart

type HelmChart struct {
	Component core.HelmChart `json:"component"`
}

func (*HelmChart) Render

func (hc *HelmChart) Render(ctx context.Context, path holos.InstancePath) (*Result, error)

type KubernetesObjects

type KubernetesObjects struct {
	Component core.KubernetesObjects `json:"component" yaml:"component"`
}

KubernetesObjects represents CUE output which directly provides Kubernetes api objects to holos.

func (*KubernetesObjects) Render

func (o *KubernetesObjects) Render(ctx context.Context, path holos.InstancePath) (*Result, error)

Render produces kubernetes api objects from the APIObjectMap of the holos component.

type KustomizeBuild

type KustomizeBuild struct {
	Component core.KustomizeBuild `json:"component" yaml:"component"`
}

KustomizeBuild renders plain yaml files in the holos component directory using kubectl kustomize build.

func (*KustomizeBuild) Render

func (kb *KustomizeBuild) Render(ctx context.Context, path holos.InstancePath) (*Result, error)

Render produces a Result by executing kubectl kustomize on the holos component path. Useful for processing raw yaml files.

type Result

type Result struct {
	// Kind is a string value representing the resource this object represents.
	Kind string `json:"kind"`
	// APIVersion represents the versioned schema of this representation of an object.
	APIVersion string `json:"apiVersion"`

	// Component represents the common fields of all holos component kinds.
	Component core.Component
	// contains filtered or unexported fields
}

Result is the build result for display or writing. Holos components Render the Result as a data pipeline.

func NewResult

func NewResult(component core.Component) *Result

NewResult returns a new Result with the given holos component.

func (*Result) AccumulatedOutput

func (r *Result) AccumulatedOutput() string

AccumulatedOutput returns the accumulated rendered output.

func (*Result) Continue

func (r *Result) Continue() bool

Continue returns true if the result should be skipped over.

func (*Result) Filename

func (r *Result) Filename(writeTo string, cluster string) string

Filename returns the filename representing the rendered api objects of the Result.

func (*Result) GetAPIVersion

func (r *Result) GetAPIVersion() string

func (*Result) GetKind

func (r *Result) GetKind() string

func (*Result) KustomizationFilename deprecated

func (r *Result) KustomizationFilename(writeTo string, cluster string) string

KustomizationFilename returns the Flux Kustomization file path.

Deprecated: Use DeployFiles instead.

func (*Result) Name

func (r *Result) Name() string

Name returns the name of the component from the Metadata field.

func (*Result) Save

func (r *Result) Save(ctx context.Context, path string, content string) error

Save writes the content to the filesystem for git ops.

func (*Result) SkipWriteAccumulatedOutput

func (r *Result) SkipWriteAccumulatedOutput() bool

SkipWriteAccumulatedOutput returns true if writing the accumulated output of k8s api objects should be skipped. Useful for results which only write deployment files, like Flux or ArgoCD GitOps resources.

func (*Result) WriteDeployFiles

func (r *Result) WriteDeployFiles(ctx context.Context, path string) error

Jump to

Keyboard shortcuts

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