Skip to content

Conversation

@dougkirkley
Copy link
Contributor

@dougkirkley dougkirkley commented Jan 13, 2026

Pull Request Template

Description

During the getGroupByName function g.SubGroups can not be nil and return an empty slice, which the recursive getGroupByName function call will return early instead of proceeding to the next group in the original groups list. This occurs when there are two groups returned via the GetGroups API call, and one of them has a child group and another one does not.

Fixes #268

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Enhancement (non-breaking change which improves an existing feature or documentation)
  • Breaking change (fix or feature that would cause existing functionality not to work as expected)

How Has This Been Tested?

Create a parent group and a child group from the issue

apiVersion: v1.edp.epam.com/v1
kind: KeycloakRealmGroup
metadata:
  name: system
  namespace: infra-system
spec:
  name: system
  realmRef:
    kind: KeycloakRealm
    name: infra
---
apiVersion: v1.edp.epam.com/v1
kind: KeycloakRealmGroup
metadata:
  name: system-no-children
  namespace: infra-system
spec:
  name: system_no_children
  realmRef:
    kind: KeycloakRealm
    name: infra
---
apiVersion: v1.edp.epam.com/v1
kind: KeycloakRealmGroup
metadata:
  name: child
  namespace: infra-system
spec:
  name: child
  realmRef:
    kind: KeycloakRealm
    name: infra
  parentGroup:
    name: system

Ensure there are no errors creating the CRs.

Checklist:

  • I have performed a self-review of my code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Pull Request contains one commit. I squash my commits.

@dougkirkley dougkirkley requested review from a team and zmotso as code owners January 13, 2026 17:00
Signed-off-by: Douglass Kirkley <doug.kirkley@gmail.com>
@dougkirkley dougkirkley force-pushed the fix/keycloakrealmgroup-sub-groups branch from 2019b9a to b8f6977 Compare January 13, 2026 17:11
@SergK SergK merged commit 45a38fa into epam:master Jan 15, 2026
9 of 10 checks passed
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

Successfully merging this pull request may close these issues.

Can't create parent and child group successfully

3 participants