crossplane-contrib / provider-gitlab

Crossplane Gitlab provider
Apache License 2.0
54 stars 26 forks source link

Group not found #109

Closed agardnerIT closed 5 months ago

agardnerIT commented 8 months ago

I have manually created a group and even setting this, crossplane doesn't seem to find it.

Using provider v0.5.0 on crossplane v1.4.1

apiVersion: groups.gitlab.crossplane.io/v1alpha1
kind: Member
metadata:
  name: user1
spec:
  forProvider:
    groupdId: 5
    groupIdRef:
      name: manualgroup1
    userID: 100
    userName: user1
    accessLevel: 50
  providerConfigRef:
    name: gitlab-provider
  writeConnectionSecretToRef:
    name: gitlab-group-user1
    namespace: crossplane

Resulting error:

cannot resolve references: spec.forProvider.groupId: cannot get referenced resource: Group.groups.gitlab.crossplane.io "manualgroup1" not found
image
janwillies commented 8 months ago

You get that error because you are referencing a group which doesn't exist in crossplane (via groupIdRef). You need to import the GitLab group via the external-name annotation. See here: https://docs.crossplane.io/knowledge-base/guides/import-existing-resources/

dvgitit commented 7 months ago

@janwillies

You get that error because you are referencing a group which doesn't exist in crossplane (via groupIdRef). You need to import the GitLab group via the external-name annotation. See here: https://docs.crossplane.io/knowledge-base/guides/import-existing-resources/

For the gitlab provider this does not seem to work. For example for importing a parent group. In the referenced docs for the manual import isn't there a missing reference to a provider config?

janwillies commented 7 months ago

This is a crossplane convention: when no providerconfig is specified, the one with the name default is chosen

MisterMX commented 5 months ago

Closing since this issue seemed to be fixed.