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

Is it possible to change implementation for groups ? #192

Closed
Neferites opened this issue Mar 5, 2024 · 4 comments
Closed

Is it possible to change implementation for groups ? #192

Neferites opened this issue Mar 5, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Neferites
Copy link

Hello
First of all, i'm grateful for this well-designed controller :).
I'm facing an issue with groups not being imported.

Group structure :

groups:
  - name: my-group
    path: /my-group
    clientRoles:
      my-first-realm:
        - impersonation
        - view-users
      my-second-realm:
        - view-users
        - impersonation

Describe the change

For now, groups are defined by : Groups []string `json:"groups,omitempty"`
From Keycloak api doc, group representation consist of maps, strings, array and subgroups.
https://www.keycloak.org/docs-api/21.0.1/rest-api/index.html#_grouprepresentation

Current situation

Groups are : Groups []string `json:"groups,omitempty"`

Should

Groups should be : Groups []GroupRepresentation `json:"groups,omitempty"`

Additional context

Add any other context about the problem here.

@raffis raffis added the bug Something isn't working label Mar 12, 2024
@raffis
Copy link
Member

raffis commented Mar 12, 2024

Yes this indeed looks like a bug, thanks for reporting.

@y3lousso
Copy link

I think the issue was not completly fixed.
When running the new version 2.2.0 and using groups: string[], I am correctly getting this error:

cannot unmarshal string into Go struct field KeycloakAPIRealm.items.spec.realm.groups of type v1beta1.KeycloakAPIGroup\n"}

Nonetheless, when I use the proper object structure

groups:
  - name: group1
    path: /group1
    clientRoles:
      role1:
        - impersonation
        - view-users
      role2:
        - impersonation
        - view-users

I get:
strict decoding error: unknown field "spec.realm.groups[0].clientRoles", unknown field "spec.realm.groups[0].name", unknown field "spec.realm.groups[0].path"

cf
https://www.keycloak.org/docs-api/24.0.1/javadocs/org/keycloak/representations/idm/GroupRepresentation.html

@raffis
Copy link
Member

raffis commented Mar 19, 2024

I can't reproduce this. Are you certain you are running the latest version as well as updated crds?
How did you deploy the release?

Please try with a new realm also.

@y3lousso
Copy link

The issue was with upgrading the CRDs, I did not know that Helm does not reinstall CRDs if it already existed 😓
Helm doc: https://helm.sh/docs/topics/charts/#limitations-on-crds

Thanks for the help 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants