github.com/operator-framework/operator-lifecycle-manager@v0.30.0/pkg/feature/feature.go (about)

     1  package feature
     2  
     3  import (
     4  	"github.com/spf13/pflag"
     5  	utilruntime "k8s.io/apimachinery/pkg/util/runtime"
     6  	"k8s.io/component-base/featuregate"
     7  )
     8  
     9  const (
    10  	// MyFeature featuregate.Feature = "MyFeature"
    11  	// owner: @username
    12  	// alpha: v1.X
    13  	// (see https://github.com/kubernetes/kubernetes/blob/master/pkg/features/kube_features.go)
    14  
    15  	// OperatorLifecycleManagerV1 enables OLM's v1 APIs.
    16  	// owner: @njhale
    17  	// alpha: v0.15.0
    18  	OperatorLifecycleManagerV1 featuregate.Feature = "OperatorLifecycleManagerV1"
    19  )
    20  
    21  var (
    22  	mutableGate featuregate.MutableFeatureGate = featuregate.NewFeatureGate()
    23  
    24  	// Gate holds the set of feature gates
    25  	Gate featuregate.FeatureGate = mutableGate
    26  )
    27  
    28  func init() {
    29  	utilruntime.Must(mutableGate.Add(featureGates))
    30  }
    31  
    32  // AddFlag adds the feature gates defined in this package to the to the given FlagSet.
    33  func AddFlag(fs *pflag.FlagSet) {
    34  	mutableGate.AddFlag(fs)
    35  }
    36  
    37  var featureGates = map[featuregate.Feature]featuregate.FeatureSpec{
    38  	OperatorLifecycleManagerV1: {Default: true, LockToDefault: true, PreRelease: featuregate.GA},
    39  }