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

Missing WithManagementPolicies in Reconciler Initialization #107

Open
etesami opened this issue Aug 30, 2024 · 0 comments · May be fixed by #108
Open

Missing WithManagementPolicies in Reconciler Initialization #107

etesami opened this issue Aug 30, 2024 · 0 comments · May be fixed by #108
Labels
bug Something isn't working

Comments

@etesami
Copy link

etesami commented Aug 30, 2024

In the current code, the managed.WithManagementPolicies() option is missing in the template within the Reconciler initialization:

r := managed.NewReconciler(mgr,
resource.ManagedKind(v1alpha1.{{ .Env.KIND }}GroupVersionKind),
managed.WithExternalConnecter(&connector{
kube: mgr.GetClient(),
usage: resource.NewProviderConfigUsageTracker(mgr.GetClient(), &apisv1alpha1.ProviderConfigUsage{}),
newServiceFn: newNoOpService}),
managed.WithLogger(o.Logger.WithValues("controller", name)),
managed.WithPollInterval(o.PollInterval),
managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))),
managed.WithConnectionPublishers(cps...))

Due to this missing line, the ManagementPolicies feature is not activated, even if the environment variable is set to enable it.

Reproduce the issue

  • Follow steps in the Readme to add a new type.
  • Once ready, try to activate the ManagementPolicies feature:
    enableManagementPolicies = app.Flag("enable-management-policies", "Enable support for Management Policies.").Default("false").Envar("ENABLE_MANAGEMENT_POLICIES").Bool()
  • Add a new resource with managementPolicies set to a non-default value.

Environment

Crossplane version: 1.16.0

@etesami etesami added the bug Something isn't working label Aug 30, 2024
etesami added a commit to etesami/provider-template that referenced this issue Aug 30, 2024
@etesami etesami linked a pull request Aug 30, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant