k8scontext

package
v0.30.11 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin added in v0.22.4

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

Implements functions for dealing with the Kubernetes context. Exposes an API for other plugins to get and validate the allowed k8s context.

func NewPlugin added in v0.22.4

func NewPlugin(context k8s.KubeContext, namespace k8s.Namespace, env clusterid.Product) Plugin

func (Plugin) NewState added in v0.22.4

func (e Plugin) NewState() interface{}

func (Plugin) OnStart added in v0.22.4

func (e Plugin) OnStart(env *starkit.Environment) error

type State

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

func GetState

func GetState(model starkit.Model) (State, error)

func MustState

func MustState(model starkit.Model) State

func (State) IsAllowed

func (s State) IsAllowed(tf *v1alpha1.Tiltfile) bool

Returns whether we're allowed to deploy to this kubecontext.

Checks against a manually specified list and a baked-in list with known dev cluster names.

Currently, only the tiltfile executor knows about "allowed" kubecontexts.

We don't keep this information around after tiltfile execution finishes.

This is incompatible with the overall technical direction of tilt as an apiserver. Objects registered via the API (like KubernetesApplys) don't get this protection. And it's currently only limited to the main Tiltfile.

A more compatible solution would be to have api server objects for the kubecontexts that tilt is aware of, and ways to mark them safe.

func (State) KubeContext

func (s State) KubeContext() k8s.KubeContext

Jump to

Keyboard shortcuts

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