sigs.k8s.io/cluster-api@v1.6.3/feature/feature.go (about)

     1  /*
     2  Copyright 2020 The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  // Package feature implements feature functionality.
    18  package feature
    19  
    20  import (
    21  	"k8s.io/apimachinery/pkg/util/runtime"
    22  	"k8s.io/component-base/featuregate"
    23  )
    24  
    25  const (
    26  	// Every feature gate should add method here following this template:
    27  	//
    28  	// // owner: @username
    29  	// // alpha: v1.X
    30  	// MyFeature featuregate.Feature = "MyFeature".
    31  
    32  	// MachinePool is a feature gate for MachinePool functionality.
    33  	//
    34  	// alpha: v0.3
    35  	MachinePool featuregate.Feature = "MachinePool"
    36  
    37  	// ClusterResourceSet is a feature gate for the ClusterResourceSet functionality.
    38  	//
    39  	// alpha: v0.3
    40  	// beta: v0.4
    41  	ClusterResourceSet featuregate.Feature = "ClusterResourceSet"
    42  
    43  	// ClusterTopology is a feature gate for the ClusterClass and managed topologies functionality.
    44  	//
    45  	// alpha: v0.4
    46  	ClusterTopology featuregate.Feature = "ClusterTopology"
    47  
    48  	// RuntimeSDK is a feature gate for the Runtime hooks and extensions functionality.
    49  	//
    50  	// alpha: v1.2
    51  	RuntimeSDK featuregate.Feature = "RuntimeSDK"
    52  
    53  	// KubeadmBootstrapFormatIgnition is a feature gate for the Ignition bootstrap format
    54  	// functionality.
    55  	//
    56  	// alpha: v1.1
    57  	KubeadmBootstrapFormatIgnition featuregate.Feature = "KubeadmBootstrapFormatIgnition"
    58  
    59  	// MachineSetPreflightChecks is a feature gate for the MachineSet preflight checks functionality.
    60  	//
    61  	// alpha: v1.5
    62  	MachineSetPreflightChecks featuregate.Feature = "MachineSetPreflightChecks"
    63  )
    64  
    65  func init() {
    66  	runtime.Must(MutableGates.Add(defaultClusterAPIFeatureGates))
    67  }
    68  
    69  // defaultClusterAPIFeatureGates consists of all known cluster-api-specific feature keys.
    70  // To add a new feature, define a key for it above and add it here.
    71  var defaultClusterAPIFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
    72  	// Every feature should be initiated here:
    73  	MachinePool:                    {Default: false, PreRelease: featuregate.Alpha},
    74  	ClusterResourceSet:             {Default: true, PreRelease: featuregate.Beta},
    75  	ClusterTopology:                {Default: false, PreRelease: featuregate.Alpha},
    76  	KubeadmBootstrapFormatIgnition: {Default: false, PreRelease: featuregate.Alpha},
    77  	RuntimeSDK:                     {Default: false, PreRelease: featuregate.Alpha},
    78  	MachineSetPreflightChecks:      {Default: false, PreRelease: featuregate.Alpha},
    79  }