Documentation ¶
Overview ¶
Package runtime handles runtime errors Wraps and reconfigures functionality in apimachinery/pkg/runtime
Index ¶
- Variables
- func EnableAllFeatures()
- func EncodeFeatures() string
- func FeatureEnabled(feature Feature) bool
- func FeaturesBindEnv() error
- func FeaturesBindFlags()
- func HandleError(logger *logrus.Entry, err error)
- func InClusterBuildConfig(logger *logrus.Entry, kubeconfigPath string) (*restclient.Config, error)
- func Must(err error)
- func NewLoggerWithSource(source string) *logrus.Entry
- func NewLoggerWithType(obj interface{}) *logrus.Entry
- func NewServerMux() *gwruntime.ServeMux
- func ParseFeatures(queryString string) error
- func ParseFeaturesFromEnv() error
- func SetLevel(level logrus.Level)
- type Feature
Constants ¶
This section is empty.
Variables ¶
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 )
Functions ¶
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
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 ¶
HandleError wraps runtime.HandleError so that it is possible to use WithField with logrus.
func InClusterBuildConfig ¶ added in v1.38.0
InClusterBuildConfig is a helper function that first attempts to build configurations using InClusterConfig(). If InClusterConfig is unsuccessful, it then tries to build configurations from a kubeconfigPath. This path is typically passed in as a command line flag for cluster components. If neither the InClusterConfig nor the kubeconfigPath are successful, the function logs a warning and falls back to a default configuration.
func NewLoggerWithSource ¶
NewLoggerWithSource returns a logrus.Entry to use when you want to specify an source
func NewLoggerWithType ¶
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
NewServerMux returns a ServeMux which is a request multiplexer for grpc-gateway. It matches http requests to pattern and invokes the corresponding handler. ref: https://grpc-ecosystem.github.io/grpc-gateway/docs/development/grpc-gateway_v2_migration_guide/#we-now-emit-default-values-for-all-fields
func ParseFeatures ¶ added in v1.3.0
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()
Types ¶
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" // FeatureGKEAutopilotExtendedDurationPods enables the use of Extended Duration pods // when Agones is running on Autopilot. Available on 1.28+ only. FeatureGKEAutopilotExtendedDurationPods = "GKEAutopilotExtendedDurationPods" // FeatureAutopilotPassthroughPort is a feature flag that enables/disables Passthrough Port Policy. FeatureAutopilotPassthroughPort Feature = "AutopilotPassthroughPort" // FeatureCountsAndLists is a feature flag that enables counts and lists feature // (a generic implenetation of the player tracking feature). FeatureCountsAndLists Feature = "CountsAndLists" // FeatureDisableResyncOnSDKServer is a feature flag to enable/disable resync on SDK server. FeatureDisableResyncOnSDKServer Feature = "DisableResyncOnSDKServer" // 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" // FeaturePortRanges is a feature flag to enable/disable specific port ranges. FeaturePortRanges Feature = "PortRanges" // FeaturePortPolicyNone is a feature flag to allow setting Port Policy to None. FeaturePortPolicyNone Feature = "PortPolicyNone" // FeatureRollingUpdateFix is a feature flag to enable/disable fleet controller fixes. FeatureRollingUpdateFix Feature = "RollingUpdateFix" // FeatureScheduledAutoscaler is a feature flag to enable/disable scheduled fleet autoscaling. FeatureScheduledAutoscaler Feature = "ScheduledAutoscaler" // FeatureExample is an example feature gate flag, used for testing and demonstrative purposes FeatureExample Feature = "Example" )