environmentflag

package
v0.0.0-...-cc466af Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

View Source
const (
	ConfigurationFileKey = "flags"
)

Variables

This section is empty.

Functions

func LoadEnvironmentFlags

func LoadEnvironmentFlags(configurationFileKey string, e EnvironmentFlags)

LoadEnvironmentFlags loads the environment flags from the configuration file. If the flags field does not exist, it returns an empty map.

Types

type Config

type Config struct {
	DesiredFlags string `json:"desiredflags" yaml:"desiredflags" default:""`
}

type EnvironmentFlag

type EnvironmentFlag int

EnvironmentFlag is integer enum for environment flags.

const (
	KubernetesUpgradeAllClusters EnvironmentFlag = iota
	WorkloadUpgradeAllClusters
	UpdateClusterName
	GatekeeperAllowedNamespaces
	UpgradeAllClusters
	UseExistingRegistries
	InstallRancher
	Long
	Short
)

EnvironmentFlag represents a flag that can be set within configuration file. To add a new flag, add it to the enum before environmentFlagLastItem. And run `go generate` in the tests/framework/pkg/environmentflag directory.

func (EnvironmentFlag) String

func (i EnvironmentFlag) String() string

type EnvironmentFlags

type EnvironmentFlags map[EnvironmentFlag]bool

EnvironmentFlags is a map of environment flags. The key is the flag enum and the value is true if the flag is set.

func NewEnvironmentFlags

func NewEnvironmentFlags() EnvironmentFlags

NewEnvironmentFlags creates a new EnvironmentFlags.

func (EnvironmentFlags) GetValue

func (e EnvironmentFlags) GetValue(flag EnvironmentFlag) bool

GetValue returns the value of the flag. If the flag is not set, it returns false.

Jump to

Keyboard shortcuts

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