declarative

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MIT Imports: 10 Imported by: 2

Documentation

Overview

The declarative package contains tools for building the manifests that the operators use in a declarative manner. A Builder can be used to build all the manifests of a package. The build process includes transforming specific manifests, common transformations for all the manifests in a package and mutating the kustomization file in the package. A builder instance can be used to apply or delete the built resource manifest.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsKustomization

func IsKustomization(path string) bool

isKustomization takes a path and returns true if the path is a kustomization file.

func ManifestTransformForPackage

func ManifestTransformForPackage(fs filesys.FileSystem, packageName string) (transform.ManifestTransform, error)

ManifestTransformForPackage returns a ManifestTransform of all the manifests in a package.

Types

type Builder

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

Builder helps build resources declaratively and apply or delete them.

func NewBuilder

func NewBuilder(packageName string, fs filesys.FileSystem, opts ...BuilderOption) (*Builder, error)

NewBuilder builds a package, given a filesystem and build options and returns a builder which can be used to apply or delete the built resource manifests.

func (*Builder) Apply

func (b *Builder) Apply(ctx context.Context) error

Apply applies the built manifest.

func (*Builder) Delete

func (b *Builder) Delete(ctx context.Context) error

Delete deletes the built manifest.

func (*Builder) Manifest

func (b *Builder) Manifest() string

Manifest returns the built manifest.

type BuilderOption

type BuilderOption func(*Builder)

BuilderOption is used to configure Builder.

func WithCommonTransforms

func WithCommonTransforms(commonTransforms []transform.TransformFunc) BuilderOption

WithCommonTransforms sets the common manifest transforms to be used by the builder.

func WithKubectlClient

func WithKubectlClient(kubectl kubectl.KubectlClient) BuilderOption

WithKubectlClient sets the kubectl client used by the builder.

func WithKustomizeMutationFunc

func WithKustomizeMutationFunc(kMutateFuncs []kustomize.MutateFunc) BuilderOption

WithKustomizeMutationFunc sets the kustomization mutation functions.

func WithManifestTransform

func WithManifestTransform(manifestTransform transform.ManifestTransform) BuilderOption

WithManifestTransform sets the ManifestTransform of the builder.

Directories

Path Synopsis
Package deleter provides a kubectl deleter that can be easily imported and used to delete resources.
Package deleter provides a kubectl deleter that can be easily imported and used to delete resources.
Package kubectl provides interface and default implementation of kubectl client to be used declaratively.
Package kubectl provides interface and default implementation of kubectl client to be used declaratively.
Package kustomize provides tools to interact with kustomization files.
Package kustomize provides tools to interact with kustomization files.

Jump to

Keyboard shortcuts

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