elevate

package
v0.1.31 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OsRemove              = os.Remove
	ExecCmd               = exec.Command
	ReadKubeConfigRaw     = utils.ReadKubeconfigRaw
	WriteKubeconfigToFile = utils.CreateTempKubeConfig
)
View Source
var (
	ModifyConfig          = clientcmd.ModifyConfig
	AskQuestionFromPrompt = utils.AskQuestionFromPrompt
)

Functions

func AddElevationReasonToRawKubeconfig

func AddElevationReasonToRawKubeconfig(config api.Config, elevationReason string) error

func AddElevationReasonsToRawKubeconfig added in v0.1.31

func AddElevationReasonsToRawKubeconfig(config api.Config, elevationReasons []string) error

func ComputeElevateContextAndStoreToKubeConfigFileAndGetReasons added in v0.1.31

func ComputeElevateContextAndStoreToKubeConfigFileAndGetReasons(config api.Config, elevationReason string) ([]string, error)

func GetElevateContextReasons added in v0.1.31

func GetElevateContextReasons(config api.Config) []string

in some cases (mainly when config is created from json) the "ElevateContext Extension" is created as runtime.Unknow object instead of the desired ElevateContext, so we need to Unmarshal the raw definition in that case

func RunElevate

func RunElevate(argv []string) error

Types

type ElevateContext added in v0.1.31

type ElevateContext struct {
	Reasons  []string  `json:"reasons"`
	LastUsed time.Time `json:"lastUsed"`
}

func (*ElevateContext) DeepCopyObject added in v0.1.31

func (r *ElevateContext) DeepCopyObject() runtime.Object

DeepCopyObject creates a deep copy of the ElevateContext.

func (*ElevateContext) GetObjectKind added in v0.1.31

func (r *ElevateContext) GetObjectKind() schema.ObjectKind

GetObjectKind returns the schema.GroupVersionKind of the object.

Jump to

Keyboard shortcuts

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