Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
cliflag "k8s.io/component-base/cli/flag"
"k8s.io/component-base/featuregate"
"k8s.io/component-base/logs"
logsv1 "k8s.io/component-base/logs/api/v1"
"k8s.io/component-base/version/verflag"
Expand All @@ -32,6 +33,7 @@ import (
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers"
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/server"
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/controllers/namespacesync"
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/features"
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/aws"
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/docker"
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic"
Expand Down Expand Up @@ -127,6 +129,12 @@ func main() {
namespacesyncOptions.AddFlags(pflag.CommandLine)
pflag.CommandLine.SetNormalizeFunc(cliflag.WordSepNormalizeFunc)
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)

// Add feature gate flags.
featureGate := featuregate.NewFeatureGate()
utilruntime.Must(featureGate.Add(features.DefaultFeatureGates()))
featureGate.AddFlag(pflag.CommandLine)

pflag.Parse()

verflag.PrintAndExitIfRequested()
Expand Down
13 changes: 13 additions & 0 deletions pkg/features/feature_gates.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright 2024 Nutanix. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

package features

import "k8s.io/component-base/featuregate"

// DefaultFeatureGates returns all known feature gates.
// To add a new feature, define a key for it above and add it here. The features will be
// available throughout the codebase.
func DefaultFeatureGates() map[featuregate.Feature]featuregate.FeatureSpec {
return map[featuregate.Feature]featuregate.FeatureSpec{}
}
Loading