Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enable DisablePropagateGenerated feature gate by default #99

Merged
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
5 changes: 5 additions & 0 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log/zap"

accuratev1 "github.com/cybozu-go/accurate/api/v1"
"github.com/cybozu-go/accurate/pkg/config"
"github.com/cybozu-go/accurate/pkg/constants"
"github.com/cybozu-go/accurate/pkg/feature"
//+kubebuilder:scaffold:imports
)

Expand Down Expand Up @@ -49,6 +51,9 @@ var _ = BeforeSuite(func() {
zap.Level(zapcore.Level(-5)),
))

// Some tests are still testing the propagate-generated feature
Expect(config.DefaultMutableFeatureGate.SetFromMap(map[string]bool{string(feature.DisablePropagateGenerated): false})).To(Succeed())

By("bootstrapping test environment")
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
Expand Down
31 changes: 31 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,35 @@ controller:
<snip>
```

## Feature Gates

Feature gates are a set of key=value pairs that describe operator features.
You can turn these features on or off using the `--feature-gates` command line flag.
Use `-h` flag to see a full set of feature gates.

To set feature gates, use the `--feature-gates` flag assigned to a list of feature pairs:

```shell
--feature-gates=...,DisablePropagateGenerated=false
```

The following table is a summary of the feature gates that you can set.

- The "Since" column contains the Accurate release when a feature is introduced
or its release stage is changed.
- The "Until" column, if not empty, contains the last Accurate release in which
you can still use a feature gate.

{{< table caption="Feature gates for features in Alpha or Beta states" sortable="true" >}}

| Feature | Default | Stage | Since | Until |
|---------|---------|-------|-------|-------|
| `DisablePropagateGenerated` | `false` | Alpha | 1.2.0 | 1.3.0 |
| `DisablePropagateGenerated` | `true` | Beta | 1.3.0 | |

Each feature gate is designed for enabling/disabling a specific feature:

- `DisablePropagateGenerated`: Disable [propagating generated resources](concepts.md#propagating-generated-resources),
which is a feature subject for removal soon.

[ResourceQuota]: https://kubernetes.io/docs/concepts/policy/resource-quotas/
3 changes: 2 additions & 1 deletion e2e/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ image:
controller:
extraArgs:
- --zap-log-level=5

# Some tests are still testing the propagate-generated feature
- --feature-gates=DisablePropagateGenerated=false
config:
labelKeys:
- team
Expand Down
2 changes: 1 addition & 1 deletion pkg/feature/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ func init() {
}

var defaultFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
DisablePropagateGenerated: {Default: false, PreRelease: featuregate.Alpha},
DisablePropagateGenerated: {Default: true, PreRelease: featuregate.Beta},
}