Documentation
¶
Overview ¶
Package template provides a factory pattern design of instantiating a new "templater" in kapp-controller some examples include cue, helm, and ytt
Index ¶
- type AdditionalDownwardAPIValues
- type AppContext
- type DownwardAPIValues
- type Factory
- func (f Factory) NewCue(opts v1alpha1.AppTemplateCue, appContext AppContext, ...) Template
- func (f Factory) NewHelmTemplate(opts v1alpha1.AppTemplateHelmTemplate, appContext AppContext, ...) *HelmTemplate
- func (f Factory) NewKbld(opts v1alpha1.AppTemplateKbld, appContext AppContext) *Kbld
- func (f Factory) NewSops(opts v1alpha1.AppTemplateSops, appContext AppContext) *Sops
- func (f Factory) NewYtt(opts v1alpha1.AppTemplateYtt, appContext AppContext, ...) *Ytt
- type HelmTemplate
- type HelmTemplateCmdArgs
- type Kbld
- type KbldOpts
- type ObjectMeta
- type PartialObjectMetadata
- type Sops
- type Template
- type Values
- type Ytt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdditionalDownwardAPIValues ¶ added in v0.52.0
type AdditionalDownwardAPIValues struct {
KappControllerVersion func() (string, error)
KubernetesVersion func() (string, error)
KubernetesAPIs func() ([]string, error)
}
AdditionalDownwardAPIValues holds values that are not computed discoverable on the resource itself
type AppContext ¶ added in v0.52.0
type AppContext struct {
Name string
Namespace string
Metadata PartialObjectMetadata
}
AppContext carries App information used across API boundaries. Primarily used in a context when templating with values
type DownwardAPIValues ¶ added in v0.52.0
type DownwardAPIValues struct {
// contains filtered or unexported fields
}
DownwardAPIValues produces multiple key-values based on the DownwardAPI config queried against the object metadata
func (DownwardAPIValues) AsYAMLs ¶ added in v0.52.0
func (a DownwardAPIValues) AsYAMLs() ([][]byte, error)
AsYAMLs returns many key-values queried (using jsonpath) against an object metadata provided, and use additionalValues.
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory allows to build various templaters e.g. ytt, cue.
func NewFactory ¶
func NewFactory(coreClient kubernetes.Interface, fetchFactory fetch.Factory, kbldAllowBuild bool, cmdRunner exec.CmdRunner) Factory
NewFactory returns template factory.
func (Factory) NewCue ¶ added in v0.52.0
func (f Factory) NewCue(opts v1alpha1.AppTemplateCue, appContext AppContext, additionalValues AdditionalDownwardAPIValues) Template
NewCue returns a Cue templater
func (Factory) NewHelmTemplate ¶
func (f Factory) NewHelmTemplate( opts v1alpha1.AppTemplateHelmTemplate, appContext AppContext, additionalValues AdditionalDownwardAPIValues) *HelmTemplate
NewHelmTemplate returns helm template.
func (Factory) NewKbld ¶
func (f Factory) NewKbld(opts v1alpha1.AppTemplateKbld, appContext AppContext) *Kbld
NewKbld returns kbld template.
func (Factory) NewSops ¶ added in v0.52.0
func (f Factory) NewSops( opts v1alpha1.AppTemplateSops, appContext AppContext) *Sops
func (Factory) NewYtt ¶
func (f Factory) NewYtt(opts v1alpha1.AppTemplateYtt, appContext AppContext, additionalValues AdditionalDownwardAPIValues) *Ytt
NewYtt returns ytt template.
type HelmTemplate ¶
type HelmTemplate struct {
// contains filtered or unexported fields
}
func NewHelmTemplate ¶
func NewHelmTemplate(opts v1alpha1.AppTemplateHelmTemplate, appContext AppContext, coreClient kubernetes.Interface, cmdRunner exec.CmdRunner, additionalValues AdditionalDownwardAPIValues) *HelmTemplate
NewHelmTemplate returns a HelmTemplate
func (*HelmTemplate) TemplateDir ¶
func (t *HelmTemplate) TemplateDir(dirPath string) (exec.CmdRunResult, bool)
TemplateDir runs helm template against a directory of files