template

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package template provides functions for templating Kubernetes resources, with standard G8S configuration.

Index

Constants

View Source
const (
	TemplateHelmChartTaskName = "template-helm-chart"

	// TemplateHelmChartTaskString is the format for printing the
	// helm chart templating task.
	// Name of the task, the helm directory path, the sha, and the version.
	TemplateHelmChartTaskString = "%s:\t%s sha:%s version:%s"

	// HelmChartYamlName is the name of Helm's chart yaml.
	HelmChartYamlName = "Chart.yaml"
	// HelmTemplateDirectoryName is the name of the directory that stores
	// Kubernetes resources inside a chart.
	HelmTemplateDirectoryName = "templates"
	// HelmDeploymentYamlName is the name of the file we template inside the
	// Helm template directory.
	HelmDeploymentYamlName = "deployment.yaml"
)

Variables

This section is empty.

Functions

func IsIncorrectSha

func IsIncorrectSha(err error) bool

IsIncorrectSha asserts incorrectShaError.

func IsIncorrectTemplating

func IsIncorrectTemplating(err error) bool

IsIncorrectTemplating asserts incorrectTemplatingError.

func IsIncorrectValue

func IsIncorrectValue(err error) bool

IsIncorrectValue asserts incorrectValueError.

func IsMultipleFilesFoundInResources

func IsMultipleFilesFoundInResources(err error) bool

IsMultipleFilesFoundInResources asserts multipleFilesFoundInResourcesError.

func IsResourceNotFound

func IsResourceNotFound(err error) bool

IsResourceNotFound asserts resourceNotFoundError.

Types

type BuildInfo

type BuildInfo struct {
	// SHA is the SHA-1 tag of the commit we are building for.
	SHA string
	// Version is the version of the commit being built.
	Version string
}

BuildInfo holds information concerning the current build.

type TemplateConfiguration

type TemplateConfiguration struct {
	// BuildInfo is the configuration for the current build
	BuildInfo
}

TemplateConfiguration holds both build info, and configuration info.

type TemplateHelmChartTask

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

func NewTemplateHelmChartTask

func NewTemplateHelmChartTask(fs afero.Fs, chartDir, sha, version string) TemplateHelmChartTask

func (TemplateHelmChartTask) Name

func (t TemplateHelmChartTask) Name() string

func (TemplateHelmChartTask) Run

func (t TemplateHelmChartTask) Run() error

Run templates the chart's Chart.yaml and templates/deployment.yaml.

func (TemplateHelmChartTask) String

func (t TemplateHelmChartTask) String() string

Jump to

Keyboard shortcuts

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