cryostat-operator icon indicating copy to clipboard operation
cryostat-operator copied to clipboard

[Request] Command line flag to force OpenShift

Open ebaron opened this issue 9 months ago • 7 comments

Describe the feature

It would be helpful for downstream releases if there was a command line option for the operator to force OpenShift instead of relying on the existing detection mechanism. Downstream releases for OpenShift won't have an OAuth2 proxy image available, only the OpenShift OAuth proxy. If the detection fails, this could result in a non-working installation.

ebaron avatar May 01 '24 21:05 ebaron

I guess this would be a flag (e.g. --platform openshift/auto ) for the controller that we can specify in its deployment? Then, we generate a new bundle for downstream with that flat set to openshift?

Maybe, for upstream, we can edit the Makefile to use envsubst for testing.

tthvo avatar May 02 '24 05:05 tthvo

I just meant something simpler than that. Just a --openshift flag that overrides the routes detection, so this function always returns true: https://github.com/cryostatio/cryostat-operator/blob/d7b0379122b9129a76b0c25ffa29923fe4ca433a/internal/main.go#L212-L214

ebaron avatar May 02 '24 13:05 ebaron

Ahh thanks I guess I was wondering what if --openshift false, that means no openshift or auto discovery? Not sure if there is a way with flag.Bool without providing defaults but I might be missing something.

tthvo avatar May 02 '24 19:05 tthvo

Ahh thanks I guess I was wondering what if --openshift false, that means no openshift or auto discovery? Not sure if there is a way with flag.Bool without providing defaults but I might be missing something.

I see, I think we should treat false as auto-discovery. We can call it force-openshift to make it clearer, what do you think?

ebaron avatar May 02 '24 20:05 ebaron

Oh yea that would work better! Okay I can help with this today :D

tthvo avatar May 02 '24 20:05 tthvo

Thanks @tthvo!

ebaron avatar May 02 '24 20:05 ebaron

I think it could be valuable for troubleshooting purposes to be able to force oauth2_proxy use on OpenShift, which seems like it could be done with a similar or the same command line flag too. This way it isn't as directly exposed as a CR field, but it's still an available option. Right now if you're on OpenShift you can only get openshift-oauth-proxy, unless you edit the Operator sources and rebuild from that.

andrewazores avatar May 03 '24 18:05 andrewazores

Just closing and track the idea in #830 :D

tthvo avatar May 23 '24 00:05 tthvo