Documentation ¶
Overview ¶
Package tanka allows to use most of Tanka's features available on the command line programmatically as a Golang library. Keep in mind that the API is still experimental and may change without and signs of warnings while Tanka is still in alpha. Nevertheless, we try to avoid breaking changes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply parses the environment at the given directory (a `baseDir`) and applies the evaluated jsonnet to the Kubernetes cluster defined in the environments `spec.json`. NOTE: This function prints on screen in default configuration. Use the `WithWarnWriter` modifier to change that. The `WithApply*` modifiers may be used to further influence the behavior.
func Diff ¶
Diff parses the environment at the given directory (a `baseDir`) and returns the differences from the live cluster state in `diff(1)` format. If the `WithDiffSummarize` modifier is used, a histogram created using `diffstat(1)` is returned instead. The cluster information is retrieved from the environments `spec.json`. NOTE: This function requires on `diff(1)`, `kubectl(1)` and perhaps `diffstat(1)`
Types ¶
type Info ¶
Info holds information about a particular environment, including its Config, the individual resources of the desired state and also the status of the client.
type Modifier ¶
type Modifier func(*options)
Modifier allow to influence the behavior of certain `tanka.*` actions. They are roughly equivalent to flags on the command line. See the `tanka.With*` functions for available options.
func WithApplyAutoApprove ¶
WithApplyAutoApprove allows to skip the interactive approval
func WithApplyForce ¶
WithApplyForce allows to invoke `kubectl apply` with the `--force` flag
func WithApplyValidate ¶ added in v0.7.1
WithApplyValidate allows to invoke `kubectl apply` with the `--validate=false` flag
func WithDiffStrategy ¶
WithDiffStrategy allows to set the used diff strategy. An empty string is ignored.
func WithDiffSummarize ¶
WithDiffSummarize enables summary mode, which invokes `diffstat(1)` on the set of changes to create an overview
func WithExtCode ¶ added in v0.7.0
WithExtCode allows to pass external variables (jsonnet code) to the VM
func WithTargets ¶
WithTargets allows to submit regular expressions to limit the working set of objects (https://tanka.dev/output-filtering/).