Skip to content

feat: Support OpenShift external IDP#2078

Open
tolusha wants to merge 7 commits intomainfrom
externalopenshiftidp
Open

feat: Support OpenShift external IDP#2078
tolusha wants to merge 7 commits intomainfrom
externalopenshiftidp

Conversation

@tolusha
Copy link
Contributor

@tolusha tolusha commented Jan 27, 2026

What does this PR do?

Support OpenShift external IDP

Screenshot/screencast of this PR

New-Incognito-Tab

What issues does this PR fix or reference?

https://issues.redhat.com/browse/CRW-9763

How to test this PR?

eclipse-che/che-docs#3024

Common Test Scenarios

  • Deploy Eclipse Che
  • Start an empty workspace
  • Open terminal and build/run an image
  • Stop a workspace
  • Check operator logs for reconciliation errors or infinite reconciliation loops
  • Advanced authorization

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
@openshift-ci
Copy link

openshift-ci bot commented Jan 27, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci
Copy link

openshift-ci bot commented Jan 27, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tolusha

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
@tolusha tolusha changed the title feat: OpenShift external IDP feat: Support OpenShift external IDP Feb 3, 2026
@tolusha tolusha marked this pull request as ready for review February 4, 2026 12:06
Copy link
Member

@ibuziuk ibuziuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, but let's postpone the merge and have it in 7.116.0 for 3.28

os.Exit(1)
}

if hasAPIGroup(apiGroups, "route.openshift.io") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We’re detecting OpenShift via the presence of the route.openshift.io API group.

Some OpenShift clusters (like microshift) may not expose routes, as it's not a core APIGroup. Would checking config.openshift.io or oauth.openshift.io be more robust?

"--config=/etc/oauth-proxy/oauth-proxy.cfg",
"--ping-path=/ping",
"--exclude-logging-path=/ping",
}
Copy link
Contributor

@rohanKanojia rohanKanojia Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, --config=/etc/oauth-proxy/oauth-proxy.cfg is duplicated in both branches. Do you think it's worth initializing a base args slice with the common config and appending conditionally?

Comment on lines +126 to +134
func hasAPIGroup(source []*metav1.APIGroup, apiName string) bool {
for i := 0; i < len(source); i++ {
if source[i].Name == apiName {
return true
}
}

return false
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use slices.ContainsFunc from the slices package (available since Go 1.21)

Suggested change
func hasAPIGroup(source []*metav1.APIGroup, apiName string) bool {
for i := 0; i < len(source); i++ {
if source[i].Name == apiName {
return true
}
}
return false
}
import "slices"
func hasAPIGroup(source []*metav1.APIGroup, apiName string) bool {
return slices.ContainsFunc(source, func(g *metav1.APIGroup) bool {
return g.Name == apiName
})
}

func GetGatewayKubernetesAuthenticationSidecarImage(checluster interface{}) string {
if !initialized {
logrus.Fatalf("Operator defaults are not initialized.")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I might not have the full context, but this package’s use of logrus.Fatalf in getters looks very unusual.

If the intent is for the operator to fail fast on misconfiguration, would it make sense to centralize the fatal behavior in Initialize() instead of spreading it across getters?

Unknown Type = iota
Kubernetes
OpenShiftV4
OpenShiftV5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be missing some context, but it looks like OpenShiftV5 is defined in the enum but never assigned at runtime.

I understand it's for forward compatibility. I suggest adding a small comment to make that explicit.

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.

3 participants