Bug 2060473

Summary: e2e-operator presubmit permafailing with: FAIL: TestKeycloakAsOIDCPasswordGrantCheck
Product: OpenShift Container Platform Reporter: Pierre Prinetti <pprinett>
Component: apiserver-authAssignee: Pierre Prinetti <pprinett>
Status: CLOSED CURRENTRELEASE QA Contact: Pierre Prinetti <pprinett>
Severity: medium Docs Contact:
Priority: high    
Version: 4.8CC: aos-bugs, mfojtik, surbania, wking, wlewis, xxia
Target Milestone: ---Keywords: TestBlocker
Target Release: 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: 2059515 Environment:
Last Closed: 2022-03-11 20:11:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2059515    
Bug Blocks: 2062292    

Description Pierre Prinetti 2022-03-03 15:18:04 UTC
+++ This bug was initially created as a clone of Bug #2059515 +++

Description of the problem:

e2e-operator pre-submit e2e jobs are failing on all releases (down to at least 4.8) due to a failure of the test `TestKeycloakAsOIDCPasswordGrantCheckAndGroupSync` (called `TestKeycloakAsOIDCPasswordGrantCheck` 4.9 and older releases).

* Debug PR triggering tests against master yields: https://prow.ci.openshift.org/pr-history/?org=openshift&repo=cluster-authentication-operator&pr=549

* Debug PR triggering tests against release-4.9 yields: https://prow.ci.openshift.org/pr-history/?org=openshift&repo=cluster-authentication-operator&pr=547

* Debug PR triggering tests against release-4.8 yields: https://prow.ci.openshift.org/pr-history/?org=openshift&repo=cluster-authentication-operator&pr=550

--- Additional comment from Xingxing Xia on 2022-03-02 02:50:11 UTC ---

It was raised in keycloak/keycloak-quickstarts#300 but no update yet, FYI.

--- Additional comment from Pierre Prinetti on 2022-03-02 08:35:20 UTC ---

> It was raised in keycloak/keycloak-quickstarts#300 but no update yet, FYI.

After a conversation with Alex Szczuczko and Dominik Guhr from the RH SSO (Keycloak) team, I suspect that the mismatch between API and docs will be solved by fixing the docs.

The patch that I propose (attached to this BZ) entails pinning our code to the "legacy" variant of Keycloak's 17.0.0 image, which exhibits the old behaviour. This patch is designed to be backported down to at least 4.8 to unblock the corresponding presubmit tests in the cluster-authentication-operator repository.

I believe that a valid follow-up will be to change the code to use the non-legacy variant: that is, issuing a "start" or "start-dev" command in the container startup.

--- Additional comment from Pierre Prinetti on 2022-03-03 15:17:28 UTC ---

The action plan:

1. Fix 4.11 by adapting the test logic to Keycloak v17 (see https://github.com/openshift/cluster-authentication-operator/pull/554)
2. Fix previous cluster-authentication-operator releases by pinning Keycloak to the "legacy" (WildFly) variant of v17

Comment 2 Pierre Prinetti 2022-03-09 13:47:21 UTC
Self-marking as VERIFIED as the change only involves test code and tests now pass.