Version: v1.35.0 Latest Latest

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 12 Imported by: 54



Package runtime handles runtime errors Wraps and reconfigures functionality in apimachinery/pkg/runtime



This section is empty.


View Source
var (

	// FeatureTestMutex is a mutex to be shared between tests to ensure that a test that involves changing featureGates
	// cannot accidentally run at the same time as another test that also changing feature flags.
	FeatureTestMutex sync.Mutex


func EnableAllFeatures added in v1.5.0

func EnableAllFeatures()

EnableAllFeatures turns on all feature flags. This is useful for libraries/processes/tests that want to enable all Alpha/Beta features without having to track all the current feature flags.

func EncodeFeatures added in v1.3.0

func EncodeFeatures() string

EncodeFeatures returns the feature set as a URL encoded query string

func FeatureEnabled added in v1.3.0

func FeatureEnabled(feature Feature) bool

FeatureEnabled returns if a Feature is enabled or not

func FeaturesBindEnv added in v1.3.0

func FeaturesBindEnv() error

FeaturesBindEnv binds the environment variables, based on the flags provided. call after viper.SetEnvKeyReplacer(...) if it is being set.

func FeaturesBindFlags added in v1.3.0

func FeaturesBindFlags()

FeaturesBindFlags does the Viper arguments configuration. Call before running pflag.Parse()

func HandleError

func HandleError(logger *logrus.Entry, err error)

HandleError wraps runtime.HandleError so that it is possible to use WithField with logrus.

func Must

func Must(err error)

Must panics if there is an error

func NewLoggerWithSource

func NewLoggerWithSource(source string) *logrus.Entry

NewLoggerWithSource returns a logrus.Entry to use when you want to specify an source

func NewLoggerWithType

func NewLoggerWithType(obj interface{}) *logrus.Entry

NewLoggerWithType returns a logrus.Entry to use when you want to use a data type as the source such as when you have a struct with methods

func NewServerMux added in v1.29.0

func NewServerMux() *gwruntime.ServeMux

NewServerMux returns a ServeMux which is a request multiplexer for grpc-gateway. It matches http requests to pattern and invokes the corresponding handler. ref:

func ParseFeatures added in v1.3.0

func ParseFeatures(queryString string) error

ParseFeatures parses the url encoded query string of features and stores the value for later retrieval

func ParseFeaturesFromEnv added in v1.3.0

func ParseFeaturesFromEnv() error

ParseFeaturesFromEnv will parse the feature flags from the Viper args configured by FeaturesBindFlags() and FeaturesBindEnv()

func SetLevel added in v1.3.0

func SetLevel(level logrus.Level)

SetLevel select level to filter logger output


type Feature added in v1.3.0

type Feature string

Feature is a type for defining feature gates.

const (
	// FeatureGateFlag is a name of a command line flag, which turns on specific tests for FeatureGates
	FeatureGateFlag = "feature-gates"

	// FeatureSplitControllerAndExtensions is a feature flag that will split agones-controller into two deployments
	FeatureSplitControllerAndExtensions Feature = "SplitControllerAndExtensions"

	// FeaturePlayerAllocationFilter is a feature flag that enables the ability for Allocations to filter based on
	// player capacity.
	FeaturePlayerAllocationFilter Feature = "PlayerAllocationFilter"

	// FeaturePlayerTracking is a feature flag to enable/disable player tracking features.
	FeaturePlayerTracking Feature = "PlayerTracking"

	// FeatureResetMetricsOnDelete is a feature flag that tells the metrics service to unregister and register
	// relevant metric views to reset their state immediately when an Agones resource is deleted.
	FeatureResetMetricsOnDelete Feature = "ResetMetricsOnDelete"

	// FeaturePodHostname enables the Pod Hostname being assigned the name of the GameServer
	FeaturePodHostname = "PodHostname"

	// FeatureFleetAllocateOverflow enables setting labels and/or annotations on Allocated GameServers
	// if the desired number of the underlying GameServerSet drops below the number of Allocated GameServers.
	FeatureFleetAllocateOverflow = "FleetAllocationOverflow"

	// FeatureCountsAndLists is a feature flag that enables/disables counts and lists feature
	// (a generic implenetation of the player tracking feature).
	FeatureCountsAndLists Feature = "CountsAndLists"

	// FeatureExample is an example feature gate flag, used for testing and demonstrative purposes
	FeatureExample Feature = "Example"

Jump to

Keyboard shortcuts

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