Skip to content

Commit

Permalink
Add feature gating system (#911)
Browse files Browse the repository at this point in the history
Co-authored-by: Ken Sipe <kensipe@gmail.com>
  • Loading branch information
gerred and kensipe committed Jan 17, 2020
1 parent 35dd036 commit 48e8c17
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ require (
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/onsi/ginkgo v1.10.1 // indirect
github.com/onsi/gomega v1.7.1
github.com/onsi/gomega v1.7.1 // indirect
github.com/opencontainers/image-spec v1.0.1 // indirect
github.com/pmezard/go-difflib v1.0.0
github.com/prometheus/client_golang v1.0.0 // indirect
Expand All @@ -56,6 +56,7 @@ require (
k8s.io/apimachinery v0.0.0-20191028221656-72ed19daf4bb
k8s.io/client-go v11.0.0+incompatible
k8s.io/code-generator v0.18.0-alpha.1.0.20191220033320-6b257a9d6f46
k8s.io/component-base v0.0.0-20191016111319-039242c015a9
k8s.io/kubectl v0.0.0-20191016120415-2ed914427d51
sigs.k8s.io/controller-runtime v0.4.0
sigs.k8s.io/controller-tools v0.2.4
Expand Down
7 changes: 7 additions & 0 deletions pkg/feature/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package feature

/*
Package feature implements feature gating for KUDO based on the Kubernetes feature gating packages.
*/
18 changes: 18 additions & 0 deletions pkg/feature/feature.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package feature

import (
"k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/component-base/featuregate"
)

var (
DefaultMutableFeatureGate featuregate.MutableFeatureGate = featuregate.NewFeatureGate()

DefaultFeatureGate featuregate.FeatureGate = DefaultMutableFeatureGate
)

func init() {
runtime.Must(DefaultMutableFeatureGate.Add(defaultKUDOFeatureGates))
}

var defaultKUDOFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{}

0 comments on commit 48e8c17

Please sign in to comment.