context

package
v0.0.0-...-e2e23a2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 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() *cobra.Command

Context points okteto to a cluster.

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 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.

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
	Filename string
}

type Options

type Options struct {
	Token                string
	Context              string
	Namespace            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