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

Crossplane 1.15 trying to use Management Policies #136

Closed
jwhitcraft opened this issue Apr 25, 2024 · 3 comments
Closed

Crossplane 1.15 trying to use Management Policies #136

jwhitcraft opened this issue Apr 25, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@jwhitcraft
Copy link

What happened?

I'm trying to import a gitlab group so it can be utilized by references

apiVersion: groups.gitlab.crossplane.io/v1alpha1
kind: Group
metadata:
  name: zys
  annotations:
    crossplane.io/external-name: 'zys'
spec:
  managementPolicies: ['Observe']
  forProvider:
    path: 'xyz/zys'

But it get this status:

atProvider: {}
conditions:
  - lastTransitionTime: 2024-04-25T12:20:39Z
    message: "`spec.managementPolicies` is set to a non-default value but the
      feature is not enabled: [Observe]"
    reason: ReconcileError
    status: "False"
    type: Synced

I believe that is caused by the Gitlab still using the EnableAlphaManagementPolicies instead of the EnableBetaManagementPolicies now that it's gone into Beta.

How can we reproduce it?

Try and import an existing group with the Observe managementPolicy set.

What environment did it happen in?

Crossplane version: 1.15.2
Crossplane Provider GitLab version: 0.6.1

$ kubectl version
Client Version: v1.30.0
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.29.3-eks-adc7111

@jwhitcraft jwhitcraft added the bug Something isn't working label Apr 25, 2024
jwhitcraft added a commit to jwhitcraft/provider-gitlab that referenced this issue Apr 26, 2024
Use the upstream feature flag to enable the Beta Management Policy support.

fixes: crossplane-contrib#136
jwhitcraft added a commit to jwhitcraft/provider-gitlab that referenced this issue Apr 26, 2024
Use the upstream feature flag to enable the Beta Management Policy support.

fixes: crossplane-contrib#136
@jwhitcraft jwhitcraft mentioned this issue Apr 26, 2024
2 tasks
jwhitcraft added a commit to jwhitcraft/provider-gitlab that referenced this issue Apr 26, 2024
Use the upstream feature flag to enable the Beta Management Policy support.

fixes: crossplane-contrib#136
jwhitcraft added a commit to jwhitcraft/provider-gitlab that referenced this issue Apr 26, 2024
Use the upstream feature flag to enable the Beta Management Policy support.

fixes: crossplane-contrib#136
Signed-off-by: Jon Whitcraft <jwhitcraft@mac.com>
@MisterMX
Copy link
Collaborator

Alpha features need to be enabled by running the provider with --enable-management-policies. Have you tried that?

@jwhitcraft
Copy link
Author

jwhitcraft commented Apr 29, 2024

I have not and, i'm not sure where to put that as i don't see a field in providerConfig for gitlab to put that.

Ok i found out how to do with the DeploymentRuntimeConfig

# The secret used here was created on the cli, the token is stored in LastPass
apiVersion: pkg.crossplane.io/v1beta1
kind: DeploymentRuntimeConfig
metadata:
  name: gitlab-runtime
spec:
  deploymentTemplate:
    spec:
      selector:
        matchLabels:
          pkg.crossplane.io/provider: provider-gitlab
      template:
        spec:
          containers:
            - name: package-runtime
              args:
                - --enable-management-policies

@MisterMX
Copy link
Collaborator

ProviderConfigs are only used to configure the connectivity of the individual controllers to the external. Runtime configurations are passed as CLI arguments when starting the provider.

Closing this, since the issue seems to be solved.

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.

2 participants