core

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEFAULT_KUBECTL_PROTECTED_COMMANDS = []string{

	"delete",
	"patch",
	"exec",
	"apply",
	"create",
	"run",
	"port-forward",
	"edit",

	"install",
	"upgrade",
	"rollback",
	"uninstall",
}

Functions

This section is empty.

Types

type ContextConf

type ContextConf struct {
	Name              string   `yaml:"name"`
	IsRegex           bool     `yaml:"isRegex"`
	ProtectedCommands []string `yaml:"commands"`
}

func NewContextConf

func NewContextConf(
	contextName string,
	safeActions []string,
) ContextConf

func (*ContextConf) IsProtected

func (c *ContextConf) IsProtected(command string) bool

type Settings

type Settings struct {
	Contexts []ContextConf `yaml:"contexts"`
	// contains filtered or unexported fields
}

func NewSettings

func NewSettings(contexts ...ContextConf) Settings

func (*Settings) AddContext

func (s *Settings) AddContext(context ContextConf) error

func (*Settings) ContainsContext

func (s *Settings) ContainsContext(context string) bool

func (*Settings) GetContextConf

func (s *Settings) GetContextConf(context string) (ContextConf, bool)

func (*Settings) RemoveContext

func (s *Settings) RemoveContext(context string) error

Jump to

Keyboard shortcuts

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