toggle

package
v1.13.2-rc.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// protect managed resource
	ProtectManagedResourcesFlagName    = "protectManagedResources"
	ProtectManagedResourcesDescription = "Set the flag to 'true', to enable managed resources protection."

	// force failure policy ignore
	ForceFailurePolicyIgnoreFlagName    = "forceFailurePolicyIgnore"
	ForceFailurePolicyIgnoreDescription = "Set the flag to 'true', to force set Failure Policy to 'ignore'."

	// enable deferred context loading
	EnableDeferredLoadingFlagName    = "enableDeferredLoading"
	EnableDeferredLoadingDescription = "enable deferred loading of context variables"

	// generate validating admission policies
	GenerateValidatingAdmissionPolicyFlagName    = "generateValidatingAdmissionPolicy"
	GenerateValidatingAdmissionPolicyDescription = "Set the flag to 'true', to generate validating admission policies."

	// dump mutate patches
	DumpMutatePatchesFlagName    = "dumpPatches"
	DumpMutatePatchesDescription = "Set the flag to 'true', to dump mutate patches."
)

Variables

View Source
var (
	ProtectManagedResources           = newToggle(defaultProtectManagedResources, protectManagedResourcesEnvVar)
	ForceFailurePolicyIgnore          = newToggle(defaultForceFailurePolicyIgnore, forceFailurePolicyIgnoreEnvVar)
	EnableDeferredLoading             = newToggle(defaultEnableDeferredLoading, enableDeferredLoadingEnvVar)
	GenerateValidatingAdmissionPolicy = newToggle(defaultGenerateValidatingAdmissionPolicy, generateValidatingAdmissionPolicyEnvVar)
	DumpMutatePatches                 = newToggle(defaultDumpMutatePatches, dumpMutatePatchesEnvVar)
)

Functions

func NewContext added in v1.10.5

func NewContext(ctx context.Context, toggles Toggles) context.Context

Types

type Toggle added in v1.8.0

type Toggle interface {
	ToggleFlag
	// contains filtered or unexported methods
}

type ToggleFlag added in v1.10.5

type ToggleFlag interface {
	Parse(string) error
}

type Toggles added in v1.10.5

type Toggles interface {
	ProtectManagedResources() bool
	ForceFailurePolicyIgnore() bool
	EnableDeferredLoading() bool
	GenerateValidatingAdmissionPolicy() bool
	DumpMutatePatches() bool
}

func FromContext added in v1.10.5

func FromContext(ctx context.Context) Toggles

Jump to

Keyboard shortcuts

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