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
6 changes: 3 additions & 3 deletions cmd/provider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func main() {
pollInterval = app.Flag("poll", "How often individual resources will be checked for drift from the desired state").Default("1m").Duration()
maxReconcileRate = app.Flag("max-reconcile-rate", "The global maximum rate per second at which resources may checked for drift from the desired state.").Default("10").Int()

enableManagementPolicies = app.Flag("enable-management-policies", "Enable support for Management Policies.").Default("false").Envar("ENABLE_MANAGEMENT_POLICIES").Bool()
enableManagementPolicies = app.Flag("enable-management-policies", "Enable support for Management Policies. Enabled by default; set to false to opt out.").Default("true").Envar("ENABLE_MANAGEMENT_POLICIES").Bool()
enableSecretCache = app.Flag("enable-secret-cache", "Enable caching of Secret objects. When true, Secrets are served from the informer cache instead of direct API calls. This reduces API server load but increases memory usage.").Default("true").Envar("ENABLE_SECRET_CACHE").Bool()
)
kingpin.MustParse(app.Parse(os.Args[1:]))
Expand Down Expand Up @@ -121,8 +121,8 @@ func main() {
}

if *enableManagementPolicies {
o.Features.Enable(features.EnableAlphaManagementPolicies)
logger.Info("Alpha feature enabled", "flag", features.EnableAlphaManagementPolicies)
o.Features.Enable(features.EnableManagementPolicies)
logger.Info("Feature enabled", "flag", features.EnableManagementPolicies)
}

kingpin.FatalIfError(upbound.Setup(mgr, o), "Cannot setup Upbound controllers")
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/cluster/repository/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func setup(mgr ctrl.Manager, o xpcontroller.Options) error {
managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))),
}

if o.Features.Enabled(features.EnableAlphaManagementPolicies) {
if o.Features.Enabled(features.EnableManagementPolicies) {
reconcilerOpts = append(reconcilerOpts, managed.WithManagementPolicies())
}

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/cluster/repositorypermission/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func setup(mgr ctrl.Manager, o xpcontroller.Options) error {
managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))),
}

if o.Features.Enabled(features.EnableAlphaManagementPolicies) {
if o.Features.Enabled(features.EnableManagementPolicies) {
reconcilerOpts = append(reconcilerOpts, managed.WithManagementPolicies())
}

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/cluster/robot/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func setup(mgr ctrl.Manager, o xpcontroller.Options) error {
managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))),
}

if o.Features.Enabled(features.EnableAlphaManagementPolicies) {
if o.Features.Enabled(features.EnableManagementPolicies) {
reconcilerOpts = append(reconcilerOpts, managed.WithManagementPolicies())
}

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/cluster/robotteammembership/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func setup(mgr ctrl.Manager, o xpcontroller.Options) error {
managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))),
}

if o.Features.Enabled(features.EnableAlphaManagementPolicies) {
if o.Features.Enabled(features.EnableManagementPolicies) {
reconcilerOpts = append(reconcilerOpts, managed.WithManagementPolicies())
}

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/cluster/team/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func setup(mgr ctrl.Manager, o xpcontroller.Options) error {
managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))),
}

if o.Features.Enabled(features.EnableAlphaManagementPolicies) {
if o.Features.Enabled(features.EnableManagementPolicies) {
reconcilerOpts = append(reconcilerOpts, managed.WithManagementPolicies())
}

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/cluster/token/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func setup(mgr ctrl.Manager, o xpcontroller.Options) error {
managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))),
}

if o.Features.Enabled(features.EnableAlphaManagementPolicies) {
if o.Features.Enabled(features.EnableManagementPolicies) {
reconcilerOpts = append(reconcilerOpts, managed.WithManagementPolicies())
}

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/namespaced/repository/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func setup(mgr ctrl.Manager, o xpcontroller.Options) error {
managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))),
}

if o.Features.Enabled(features.EnableAlphaManagementPolicies) {
if o.Features.Enabled(features.EnableManagementPolicies) {
reconcilerOpts = append(reconcilerOpts, managed.WithManagementPolicies())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func setup(mgr ctrl.Manager, o xpcontroller.Options) error {
managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))),
}

if o.Features.Enabled(features.EnableAlphaManagementPolicies) {
if o.Features.Enabled(features.EnableManagementPolicies) {
reconcilerOpts = append(reconcilerOpts, managed.WithManagementPolicies())
}

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/namespaced/robot/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func setup(mgr ctrl.Manager, o xpcontroller.Options) error {
managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))),
}

if o.Features.Enabled(features.EnableAlphaManagementPolicies) {
if o.Features.Enabled(features.EnableManagementPolicies) {
reconcilerOpts = append(reconcilerOpts, managed.WithManagementPolicies())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func setup(mgr ctrl.Manager, o xpcontroller.Options) error {
managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))),
}

if o.Features.Enabled(features.EnableAlphaManagementPolicies) {
if o.Features.Enabled(features.EnableManagementPolicies) {
reconcilerOpts = append(reconcilerOpts, managed.WithManagementPolicies())
}

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/namespaced/team/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func setup(mgr ctrl.Manager, o xpcontroller.Options) error {
managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))),
}

if o.Features.Enabled(features.EnableAlphaManagementPolicies) {
if o.Features.Enabled(features.EnableManagementPolicies) {
reconcilerOpts = append(reconcilerOpts, managed.WithManagementPolicies())
}

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/namespaced/token/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func setup(mgr ctrl.Manager, o xpcontroller.Options) error {
managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))),
}

if o.Features.Enabled(features.EnableAlphaManagementPolicies) {
if o.Features.Enabled(features.EnableManagementPolicies) {
reconcilerOpts = append(reconcilerOpts, managed.WithManagementPolicies())
}

Expand Down
8 changes: 5 additions & 3 deletions internal/features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ import "github.com/crossplane/crossplane-runtime/v2/pkg/feature"

// Feature flags.
const (
// EnableAlphaManagementPolicies enables alpha support for
// Management Policies. See the below design for more details.
// EnableManagementPolicies enables support for Management Policies.
// Management Policies are a stable Crossplane feature and this is enabled
// by default; it can be turned off with --enable-management-policies=false.
// See the below design for more details.
// https://github.com/crossplane/crossplane/pull/3531
EnableAlphaManagementPolicies feature.Flag = "EnableAlphaManagementPolicies"
EnableManagementPolicies feature.Flag = "EnableManagementPolicies"
)
Loading