generated from cybozu-go/neco-template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from erikgb/propagate-generated-feature-gate
feat: add DisablePropagateGenerated feature gate
- Loading branch information
Showing
6 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package config | ||
|
||
import "k8s.io/component-base/featuregate" | ||
|
||
var ( | ||
// DefaultMutableFeatureGate is a mutable version of DefaultFeatureGate. | ||
// Only top-level commands/options setup should make use of this. | ||
DefaultMutableFeatureGate featuregate.MutableFeatureGate = featuregate.NewFeatureGate() | ||
|
||
// DefaultFeatureGate is a shared global FeatureGate. | ||
// Top-level commands/options setup that needs to modify this feature gate should use DefaultMutableFeatureGate. | ||
DefaultFeatureGate featuregate.FeatureGate = DefaultMutableFeatureGate | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package feature | ||
|
||
import ( | ||
"github.com/cybozu-go/accurate/pkg/config" | ||
"k8s.io/apimachinery/pkg/util/runtime" | ||
"k8s.io/component-base/featuregate" | ||
) | ||
|
||
// DisablePropagateGenerated will disable watch for owners with propagate-generated | ||
// annotation. This could be useful to avoid Accurate from attempting to modify resources | ||
// in namespaces that should be out-of-scope for Accurate. | ||
const DisablePropagateGenerated featuregate.Feature = "DisablePropagateGenerated" | ||
|
||
func init() { | ||
runtime.Must(config.DefaultMutableFeatureGate.Add(defaultFeatureGates)) | ||
} | ||
|
||
var defaultFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{ | ||
DisablePropagateGenerated: {Default: false, PreRelease: featuregate.Alpha}, | ||
} |