sigs.k8s.io/cluster-api-provider-azure@v1.14.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
    18  
    19  import (
    20  	"k8s.io/apimachinery/pkg/util/runtime"
    21  	"k8s.io/component-base/featuregate"
    22  )
    23  
    24  const (
    25  	//nolint:godot // Ignore "Comment should end in a period" check.
    26  	// Every capz-specific feature gate should add a method here following this template:
    27  	//
    28  	// // MyFeature is the feature gate for my feature.
    29  	// // owner: @username
    30  	// // alpha: v1.X
    31  	// MyFeature featuregate.Feature = "MyFeature"
    32  
    33  	//nolint:godot // Ignore "Comment should end in a period" check.
    34  	// AKS is the feature gate for AKS managed clusters.
    35  	// owner: @jackfrancis @nojnhuh
    36  	// alpha: v0.4
    37  	// GA: v1.8
    38  	AKS featuregate.Feature = "AKS"
    39  
    40  	// AKSResourceHealth is the feature gate for reporting Azure Resource Health
    41  	// on AKS managed clusters.
    42  	// owner: @nojnhuh
    43  	// alpha: v1.7
    44  	AKSResourceHealth featuregate.Feature = "AKSResourceHealth"
    45  
    46  	// EdgeZone is the feature gate for creating clusters on public MEC.
    47  	// owner: @upxinxin
    48  	// alpha: v1.8
    49  	EdgeZone featuregate.Feature = "EdgeZone"
    50  )
    51  
    52  func init() {
    53  	runtime.Must(MutableGates.Add(defaultCAPZFeatureGates))
    54  }
    55  
    56  // defaultCAPZFeatureGates consists of all known capz-specific feature keys.
    57  // To add a new feature, define a key for it above and add it here.
    58  var defaultCAPZFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
    59  	// Every feature should be initiated here:
    60  	AKS:               {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // Remove in 1.12
    61  	AKSResourceHealth: {Default: false, PreRelease: featuregate.Alpha},
    62  	EdgeZone:          {Default: false, PreRelease: featuregate.Alpha},
    63  }