Closed twuyts closed 3 months ago
Relates to https://github.com/crossplane-contrib/provider-keycloak/issues/126
Closing this issue as a duplicate, it is clear there is no clearcut solution
FWIW: I worked around it by having a LegacyImport
task that uses the keycloak api to list all relevant roles, and create a Crossplane Role with the external-name
annotation.
(This is a question, rather than an actual issue.) We have an existing keycloak that we want to start managing using crossplane, instead of directly with the keycloak rest api, like we do now. But I'm having trouble getting crossplane to import existing resources, using the method described in https://docs.crossplane.io/latest/guides/import-existing-resources/.
For example, when I create a
Role
namedmy-role
for a keycloak role that already exists, you getCannotCreateExternalResource
failure, with a409: Conflict
. When I add the annotationcrossplane.io/external-name: 'my-role'
, the status showsobserve failed: external resource does not exist
. It's only when I use the keycloak UUID of the role in that annotation, that I get a status of Success.Is there any way of getting the operator to import the resource based on the name rather than the UUID?
And if not, what would you suggest as plan of action for making these resources usable by crossplane?