featureflag

package
v1.30.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 5 Imported by: 320

Documentation

Overview

Package featureflag implements simple feature-flagging. Feature flags can become an anti-pattern if abused. We should try to use them for two use-cases:

  • `Preview` feature flags enable a piece of functionality we haven't yet fully baked. The user needs to 'opt-in'. We expect these flags to be removed at some time. Normally these will default to false.
  • Escape-hatch feature flags turn off a default that we consider risky (e.g. pre-creating DNS records). This lets us ship a behaviour, and if we encounter unusual circumstances in the field, we can allow the user to turn the behaviour off. Normally these will default to true.

Index

Constants

View Source
const (
	// Name is the name of the environment variable which encapsulates feature flags
	Name = "KOPS_FEATURE_FLAGS"
)

Variables

View Source
var (
	// CacheNodeidentityInfo enables NodeidentityInfo caching
	// in order to reduce the number of EC2 DescribeInstance calls.
	CacheNodeidentityInfo = new("CacheNodeidentityInfo", Bool(false))
	// EnableSeparateConfigBase allows a config-base that is different from the state store
	EnableSeparateConfigBase = new("EnableSeparateConfigBase", Bool(false))
	// ExperimentalClusterDNS allows for setting the kubelet dns flag to experimental values.
	ExperimentalClusterDNS = new("ExperimentalClusterDNS", Bool(false))
	// GoogleCloudBucketACL means the ACL will be set on a bucket when using GCS
	GoogleCloudBucketACL = new("GoogleCloudBucketAcl", Bool(false))
	// Spotinst toggles the use of Spotinst integration.
	Spotinst = new("Spotinst", Bool(false))
	// SpotinstOcean toggles the use of Spotinst Ocean instance group implementation.
	SpotinstOcean = new("SpotinstOcean", Bool(false))
	// SpotinstOceanTemplate toggles the use of Spotinst Ocean object as a template for Virtual Node Groups.
	SpotinstOceanTemplate = new("SpotinstOceanTemplate", Bool(false))
	// SpotinstHybrid toggles between hybrid and full instance group implementations.
	SpotinstHybrid = new("SpotinstHybrid", Bool(false))
	// SpotinstController toggles the installation of the Spotinst controller addon.
	SpotinstController = new("SpotinstController", Bool(true))
	// VPCSkipEnableDNSSupport if set will make that a VPC does not need DNSSupport enabled.
	VPCSkipEnableDNSSupport = new("VPCSkipEnableDNSSupport", Bool(false))
	// SkipEtcdVersionCheck will bypass the check that etcd-manager is using a supported etcd version
	SkipEtcdVersionCheck = new("SkipEtcdVersionCheck", Bool(false))
	// ClusterAddons activates experimental cluster-addons support
	ClusterAddons = new("ClusterAddons", Bool(false))
	// Azure toggles the Azure support.
	Azure = new("Azure", Bool(false))
	// APIServerNodes enables ability to provision nodes that only run the kube-apiserver.
	APIServerNodes = new("APIServerNodes", Bool(false))
	// UseAddonOperators activates experimental addon operator support
	UseAddonOperators = new("UseAddonOperators", Bool(false))
	// TerraformManagedFiles enables rendering managed files into the Terraform configuration.
	TerraformManagedFiles = new("TerraformManagedFiles", Bool(true))
	// ImageDigest remaps all manifests with image digests
	ImageDigest = new("ImageDigest", Bool(true))
	// Scaleway toggles the Scaleway Cloud support.
	Scaleway = new("Scaleway", Bool(false))
	// SELinuxMount configures AWS EBS CSI driver for SELinuxMount support.
	// It expects than Kubernetes feature gate SELinuxMountReadWriteOncePod is
	// enabled or GA in the API server, KCM and kubelet.
	// OS with SELinux support on all nodes is recommended, but not required
	// - the feature won't do anything when the node OS does not support SELinux.
	// TODO(jsafrane): add to all CSI drivers installed by kops.
	SELinuxMount = new("SELinuxMount", Bool(false))
	// DO Terraform toggles the DO terraform support.
	DOTerraform = new("DOTerraform", Bool(false))
	// Metal enables the experimental bare-metal support.
	Metal = new("Metal", Bool(false))
	// AWSSingleNodesInstanceGroup enables the creation of a single node instance group instead of one per availability zone.
	AWSSingleNodesInstanceGroup = new("AWSSingleNodesInstanceGroup", Bool(false))
)

Functions

func Bool

func Bool(b bool) *bool

Bool returns a pointer to the boolean value

func ParseFlags

func ParseFlags(f string)

ParseFlags responsible for parse out the feature flag usage

Types

type FeatureFlag

type FeatureFlag struct {
	Key string
	// contains filtered or unexported fields
}

FeatureFlag defines a feature flag

func Get added in v1.26.0

func Get(flagName string) (*FeatureFlag, error)

Get returns given FeatureFlag.

func (*FeatureFlag) Enabled

func (f *FeatureFlag) Enabled() bool

Enabled checks if the flag is enabled

Jump to

Keyboard shortcuts

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