context

package
v0.0.0-...-06d3161 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 32 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// OktetoUseStaticKubetokenEnvVar is used to opt in to use static kubetoken
	OktetoUseStaticKubetokenEnvVar = "OKTETO_USE_STATIC_KUBETOKEN"
)

Variables

This section is empty.

Functions

func Context

func Context(okClientProvider oktetoClientProvider) *cobra.Command

Context points okteto to a cluster.

func CreateCMD

func CreateCMD() *cobra.Command

CreateCMD adds a new cluster to okteto context

func Delete

func Delete(okCtxs []string) error

func DeleteCMD

func DeleteCMD() *cobra.Command

DeleteCMD removes a cluster from okteto context

func List

func List() *cobra.Command

List returns all contexts managed by okteto

func LoadContextFromPath

func LoadContextFromPath(ctx context.Context, namespace, k8sContext, path string, defaultCtxOpts Options) error

LoadContextFromPath initializes the okteto context taking into account command flags and manifest namespace/context fields

func LoadManifestWithContext

func LoadManifestWithContext(ctx context.Context, opts ManifestOptions, fs afero.Fs) (*model.Manifest, error)

LoadManifestWithContext loads context and then loads a manifest

func LoadStackWithContext

func LoadStackWithContext(ctx context.Context, name, namespace string, stackPaths []string, fs afero.Fs) (*model.Stack, error)

func Show

func Show() *cobra.Command

Show current context

func UpdateKubeconfigCMD

func UpdateKubeconfigCMD(okClientProvider oktetoClientProvider) *cobra.Command

UpdateKubeconfigCMD all contexts managed by okteto

func Use

func Use() *cobra.Command

Use context points okteto to a cluster.

func UseNamespace

func UseNamespace() *cobra.Command

UseNamespace changes your current context namespace.

Types

type Command

type Command struct {
	K8sClientProvider    okteto.K8sClientProvider
	LoginController      login.Interface
	OktetoClientProvider oktetoClientProvider

	OktetoContextWriter okteto.ContextConfigWriterInterface
	// contains filtered or unexported fields
}

Command has the dependencies to run a ctxCommand

func NewContextCommand

func NewContextCommand(ctxCmdOption ...ctxCmdOption) *Command

NewContextCommand creates a new Command

func (*Command) Run

func (c *Command) Run(ctx context.Context, ctxOptions *Options) error

func (*Command) RunStateless

func (c *Command) RunStateless(ctx context.Context, ctxOptions *Options) (*okteto.ContextStateless, error)

RunStateless is the fn to use until the refactoring of the context command itself if you want to make use of an injected context instead of using the global context variable.

func (*Command) UseContext

func (c *Command) UseContext(ctx context.Context, ctxOptions *Options) error

type KubeconfigCMD

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

type ManifestOptions

type ManifestOptions struct {
	Name       string
	Namespace  string
	Filename   string
	K8sContext string
}

type Options

type Options struct {
	Token                string
	Context              string
	Namespace            string
	Builder              string
	OnlyOkteto           bool
	Show                 bool
	Save                 bool
	SetCurrentNs         bool
	IsCtxCommand         bool
	CheckNamespaceAccess bool
	IsOkteto             bool

	InsecureSkipTlsVerify bool
	InferredToken         bool
	// contains filtered or unexported fields
}

func (*Options) InitFromContext

func (o *Options) InitFromContext()

func (*Options) InitFromEnvVars

func (o *Options) InitFromEnvVars()

type SelectItem

type SelectItem struct {
	Name   string
	Enable bool
}

Jump to

Keyboard shortcuts

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