crossplane-contrib / provider-gitlab

Crossplane Gitlab provider
Apache License 2.0
55 stars 30 forks source link

Can not create groups at the basepath #117

Closed dariozachow closed 8 months ago

dariozachow commented 8 months ago

What happened?

Creating a group without setting the parentID in the spec leads to an conversion Issue, when parsing the parentID even tough its not available. The Gitlab-API does not require the parentID to create new groups as stated here: https://docs.gitlab.com/ee/api/groups.html#new-group but is used by the provider. Therefore it is not possible to create groups at the base level of gitlab or for users.

How can we reproduce it?

The applied yaml:

apiVersion: groups.gitlab.crossplane.io/v1alpha1
kind: Group
metadata:
  name: my-group
spec:
  forProvider:
    description: my group
    name: test
    path: test
    visibility: internal
  providerConfigRef:
    name: gitlab-provider

Error Message:

status:
  atProvider: {}
  conditions:
    - lastTransitionTime: '2024-01-30T13:33:40Z'
      message: >-
        cannot resolve references: mg.Spec.ForProvider.ParentID: strconv.Atoi:
        parsing "": invalid syntax
      reason: ReconcileError
      status: 'False'
      type: Synced

What environment did it happen in?

Crossplane version: 1.14.5 Crossplane Provider GitLab version: v0.5.0