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

How to import existing Roles based on their name? #144

Closed
twuyts opened this issue Jul 29, 2024 · 1 comment
Closed

How to import existing Roles based on their name? #144

twuyts opened this issue Jul 29, 2024 · 1 comment

Comments

@twuyts
Copy link

twuyts commented Jul 29, 2024

(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 named my-role for a keycloak role that already exists, you get CannotCreateExternalResource failure, with a 409: Conflict. When I add the annotation crossplane.io/external-name: 'my-role', the status shows observe 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?

@twuyts
Copy link
Author

twuyts commented Aug 1, 2024

Relates to #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.

@twuyts twuyts closed this as not planned Won't fix, can't repro, duplicate, stale Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant