Skip to content

Commit

Permalink
Set management policies flag to true by default
Browse files Browse the repository at this point in the history
Signed-off-by: Fatih Türken <turkenf@gmail.com>
  • Loading branch information
turkenf committed Oct 26, 2023
1 parent e92312d commit e36c08d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
11 changes: 3 additions & 8 deletions cmd/provider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func main() {
namespace = app.Flag("namespace", "Namespace used to set as default scope in default secret store config.").Default("crossplane-system").Envar("POD_NAMESPACE").String()
enableExternalSecretStores = app.Flag("enable-external-secret-stores", "Enable support for ExternalSecretStores.").Default("false").Envar("ENABLE_EXTERNAL_SECRET_STORES").Bool()
essTLSCertsPath = app.Flag("ess-tls-cert-dir", "Path of ESS TLS certificates.").Envar("ESS_TLS_CERTS_DIR").String()
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.").Default("true").Envar("ENABLE_MANAGEMENT_POLICIES").Bool()
)

kingpin.MustParse(app.Parse(os.Args[1:]))
Expand Down Expand Up @@ -126,8 +126,8 @@ func main() {
}

if *enableManagementPolicies {
o.Features.Enable(features.EnableAlphaManagementPolicies)
log.Info("Alpha feature enabled", "flag", features.EnableAlphaManagementPolicies)
o.Features.Enable(features.EnableBetaManagementPolicies)
log.Info("Beta feature enabled", "flag", features.EnableBetaManagementPolicies)
}
o.WorkspaceStore = terraform.NewWorkspaceStore(log, terraform.WithDisableInit(len(*nativeProviderPath) != 0), terraform.WithProcessReportInterval(*pollInterval), terraform.WithFeatures(o.Features))

Expand Down Expand Up @@ -159,11 +159,6 @@ func main() {
})), "cannot create default store config")
}

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

rand.Seed(time.Now().UnixNano())
kingpin.FatalIfError(controller.Setup(mgr, o), "Cannot setup Azuread controllers")
kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager")
Expand Down
4 changes: 2 additions & 2 deletions internal/features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const (
// https://github.com/crossplane/crossplane/blob/390ddd/design/design-doc-external-secret-stores.md
EnableAlphaExternalSecretStores feature.Flag = "EnableAlphaExternalSecretStores"

// EnableAlphaManagementPolicies enables alpha support for
// EnableBetaManagementPolicies enables beta support for
// Management Policies. See the below design for more details.
// https://github.com/crossplane/crossplane/pull/3531
EnableAlphaManagementPolicies feature.Flag = "EnableAlphaManagementPolicies"
EnableBetaManagementPolicies feature.Flag = "EnableBetaManagementPolicies"
)

0 comments on commit e36c08d

Please sign in to comment.