Documentation
¶
Overview ¶
Package features declares Mokka's feature gates on top of the Kubernetes component-base feature gate, so operators use the same syntax and lifecycle they know from Kubernetes components.
Index ¶
Constants ¶
const ( // FlagName is the command-line flag of the services that apply gates: // node-agent, nri-plugin and control-plane. FlagName = "feature-gates" // EnvName is the environment variable those services read when the flag // is not set. EnvName = "MOKKA_FEATURE_GATES" )
const ( // issue: https://github.com/NVIDIA/k8s-test-infra/issues/821 // // Lets the node agent download the IMEX archive it pins from NVIDIA into // a node cache when no archive is provided. To be deprecated once Mokka // publishes the IMEX binaries image. IMEXDownload featuregate.Feature = "IMEXDownload" )
Declare each gate as a featuregate.Feature constant here and add its lifecycle to versionedSpecs below. node-agent, nri-plugin and control-plane apply every gate, so the chart can pass one list to all of them. No other process applies gates: nvml-mock-ctl and the mock NVML and CUDA libraries always see the defaults, so code they share with the services must receive the decision as a value rather than call Enabled.
Example:
// owner: @github-handle // issue: https://github.com/NVIDIA/k8s-test-infra/issues/1234 // // Selects the alternate placement planner. AlternatePlanner featuregate.Feature = "AlternatePlanner"
Variables ¶
This section is empty.
Functions ¶
func CLIFlag ¶
CLIFlag returns the --feature-gates flag of the services that apply gates. Like the Kubernetes components' flag, its help lists the alpha and beta gates with their defaults.
func ConfigureFromCLI ¶
ConfigureFromCLI applies the --feature-gates value and logs the resulting state. Call it once, before starting any workers.
func Enabled ¶
func Enabled(f featuregate.Feature) bool
Enabled reports whether a feature gate is enabled in this process.
func SetFeatureGateDuringTest ¶
func SetFeatureGateDuringTest(tb testing.TB, f featuregate.Feature, value bool)
SetFeatureGateDuringTest overrides a gate for the duration of a test and restores it on cleanup. Tests that call it must not run in parallel with other tests that read the same gate.
Types ¶
This section is empty.