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

feature: Import objects via <realm/name> instead of <uuid> #126

Open
Breee opened this issue Jul 2, 2024 · 2 comments
Open

feature: Import objects via <realm/name> instead of <uuid> #126

Breee opened this issue Jul 2, 2024 · 2 comments

Comments

@Breee
Copy link
Collaborator

Breee commented Jul 2, 2024

Currently we have to import resources using keycloaks UUIDs,
i.e.

apiVersion: role.keycloak.crossplane.io/v1alpha1
kind: Role
metadata:
  annotations:
    crossplane.io/external-name: 182b0c9b-197f-45e3-8f4a-386cd6890d73
  name: builtin-master-realm-role-uma-authorization
spec:
  deletionPolicy: Orphan
  forProvider:
    name: uma_authorization
    realmId: master
  managementPolicies:
  - Observe
  providerConfigRef:
    name: keycloak-provider-config

It would be better to have something like:

apiVersion: role.keycloak.crossplane.io/v1alpha1
kind: Role
metadata:
  annotations:
    crossplane.io/external-name: master/uma_authorization
  name: builtin-master-realm-role-uma-authorization
spec:
  deletionPolicy: Orphan
  forProvider:
    name: uma_authorization
    realmId: master
  managementPolicies:
  - Observe
  providerConfigRef:
    name: keycloak-provider-config

to make it more resilient for disaster recovery

@Breee Breee added feature enhancement New feature or request labels Jul 2, 2024
@TomBillietKlarrio
Copy link

I was wondering, what would be the behavior if in external_name.go the config is changed to config.NameAsIdentifier

"keycloak_openid_client": config.IdentifierFromProvider,

Would it try to reconcile based on the name instead of the UUID? I was trying it myself, but did not figure out how to run a custom built version on my kind cluster

@Breee
Copy link
Collaborator Author

Breee commented Jul 3, 2024

afaik config.NameAsIdentifier would remove all "name" fields from the forProvider and use the K8s object name as identifier.
that's not what we search i think -> we'll find a smooth way to get rid of the uuids in the future. To this date this does not exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants