parameterizer

package
v0.3.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PackagingKind is the kind for Packaging yamls
	PackagingKind = "Packaging"
	// ParameterizerKind is the kind for Parameterizer yamls
	ParameterizerKind = "Parameterizer"
	// ReplaceOp replaces the value at the key with a different value
	ReplaceOp PatchOpT = "replace"
	// AddOp inserts a value at the key
	AddOp PatchOpT = "add"
	// RemoveOp removes the value at the key
	RemoveOp PatchOpT = "remove"
	// TargetHelm is used when the target is the parameterization of Helm
	TargetHelm ParamTargetT = "helm"
	// TargetKustomize is used when the target is the parameterization of Kustomize
	TargetKustomize ParamTargetT = "kustomize"
	// TargetOCTemplates is used when the target is the parameterization of Openshift Templates
	TargetOCTemplates ParamTargetT = "openshifttemplates"
	// ParamQuesIDPrefix is used as a prefix when the key is not specified in the questions in a parameterizer
	ParamQuesIDPrefix = common.BaseKey + common.Delim + "parameterization"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterT

type FilterT struct {
	Kind       string   `yaml:"kind,omitempty" json:"kind,omitempty"`
	APIVersion string   `yaml:"apiVersion,omitempty" json:"apiVersion,omitempty"`
	Name       string   `yaml:"name,omitempty" json:"name,omitempty"`
	Envs       []string `yaml:"envs,omitempty" json:"envs,omitempty"`
}

FilterT is used to choose the k8s resources that the parameterizer should be applied on

type HelmValuesT

type HelmValuesT map[string]interface{}

HelmValuesT has Helm Values

type K8sResourceT

type K8sResourceT = map[string]interface{}

K8sResourceT is a k8s resource

type OCParamT

type OCParamT struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
}

OCParamT is the type for a single Openshift Templates parameter

type PackagingFileT

type PackagingFileT struct {
	metav1.TypeMeta   `yaml:",inline" json:",inline"`
	metav1.ObjectMeta `yaml:"metadata" json:"metadata"`
	Spec              PackagingSpecT `yaml:"spec" json:"spec"`
}

PackagingFileT is the file format for the packaging

type PackagingSpecPathT

type PackagingSpecPathT struct {
	Src           string   `yaml:"src" json:"src"`
	Out           string   `yaml:"out,omitempty" json:"out,omitempty"`
	Helm          string   `yaml:"helm,omitempty" json:"helm,omitempty"`
	HelmChartName string   `yaml:"helmChartName,omitempty" json:"helmChartName,omitempty"`
	Kustomize     string   `yaml:"kustomize,omitempty" json:"kustomize,omitempty"`
	OCTemplates   string   `yaml:"openshiftTemplates,omitempty" json:"openshiftTemplates,omitempty"`
	Envs          []string `yaml:"envs,omitempty" json:"envs,omitempty"`
}

PackagingSpecPathT is the set of source paths to be parameterized

type PackagingSpecT

type PackagingSpecT struct {
	FilePath          string               `yaml:"-" json:"-"`
	Paths             []PackagingSpecPathT `yaml:"paths" json:"paths"`
	ParameterizerRefs []string             `yaml:"parameterizerRefs,omitempty" json:"parameterizerRefs,omitempty"`
	Parameterizers    []ParameterizerT     `yaml:"parameterizers,omitempty" json:"parameterizers,omitempty"`
}

PackagingSpecT is the spec inside the packaging file

type ParamOrStringT

type ParamOrStringT struct {
	IsParam bool
	Data    string
}

ParamOrStringT is string along with a flag to indicate if it is a parameter

type ParamTargetT

type ParamTargetT string

ParamTargetT has Param Target

type ParameterT

type ParameterT struct {
	Name              string            `yaml:"name" json:"name"`
	Default           string            `yaml:"default,omitempty" json:"default,omitempty"`
	HelmTemplate      string            `yaml:"helmTemplate,omitempty" json:"helmTemplate,omitempty"`
	OpenshiftTemplate string            `yaml:"openshiftTemplate,omitempty" json:"openshiftTemplate,omitempty"`
	Values            []ParameterValueT `yaml:"values,omitempty" json:"values,omitempty"`
}

ParameterT is used to specify the environment specific defaults for the keys in the template

type ParameterValueT

type ParameterValueT struct {
	Envs         []string          `yaml:"envs,omitempty" json:"envs,omitempty"`
	Kind         string            `yaml:"kind,omitempty" json:"kind,omitempty"`
	APIVersion   string            `yaml:"apiVersion,omitempty" json:"apiVersion,omitempty"`
	MetadataName string            `yaml:"metadataName,omitempty" json:"metadataName,omitempty"`
	Custom       map[string]string `yaml:"custom,omitempty" json:"custom,omitempty"`
	Value        string            `yaml:"value" json:"value"`
}

ParameterValueT is used to specify the value for a parameter in different contexts

type ParameterizerFileT

type ParameterizerFileT struct {
	metav1.TypeMeta   `yaml:",inline" json:",inline"`
	metav1.ObjectMeta `yaml:"metadata" json:"metadata"`
	Spec              ParameterizerSpecT `yaml:"spec" json:"spec"`
}

ParameterizerFileT is the file format for the parameterizers

type ParameterizerSpecT

type ParameterizerSpecT struct {
	Parameterizers []ParameterizerT `yaml:"parameterizers" json:"parameterizers"`
}

ParameterizerSpecT is the spec inside the parameterizers file

type ParameterizerT

type ParameterizerT struct {
	Target     string            `yaml:"target" json:"target"`
	Template   string            `yaml:"template,omitempty" json:"template,omitempty"`
	Regex      string            `yaml:"regex,omitempty" json:"regex,omitempty"`
	Default    interface{}       `yaml:"default,omitempty" json:"default,omitempty"`
	Question   *qaengine.Problem `yaml:"question,omitempty" json:"question,omitempty"`
	Filters    []FilterT         `yaml:"filters,omitempty" json:"filters,omitempty"`
	Parameters []ParameterT      `yaml:"parameters,omitempty" json:"parameters,omitempty"`
}

ParameterizerT is a paramterizer

type PatchMetadataT

type PatchMetadataT struct {
	Path   string               `yaml:"path"`
	Target PatchMetadataTargetT `yaml:"target"`
}

PatchMetadataT is contains the target k8s resources and the patch filename

type PatchMetadataTargetT

type PatchMetadataTargetT struct {
	Group     string `yaml:"group"`
	Version   string `yaml:"version"`
	Kind      string `yaml:"kind"`
	Namespace string `yaml:"namespace,omitempty"`
	Name      string `yaml:"name"`
}

PatchMetadataTargetT is used to specify the target k8s resource that the json path should be applied on (this is specific to kustomize)

type PatchOpT

type PatchOpT string

PatchOpT has Patch

type PatchT

type PatchT struct {
	Op    PatchOpT    `yaml:"op"`
	Path  string      `yaml:"path"`
	Value interface{} `yaml:"value"`
}

PatchT represents a single json patch https://tools.ietf.org/html/rfc6902

Jump to

Keyboard shortcuts

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