operator-framework / operator-lifecycle-manager

A management framework for extending Kubernetes with Operators
https://olm.operatorframework.io
Apache License 2.0
1.72k stars 545 forks source link

(OLM) How to unset env var at the subscription level ? #1981

Open abouchama opened 3 years ago

abouchama commented 3 years ago

How to unset env var at the subscription level ? --> https://github.com/operator-framework/operator-lifecycle-manager/blob/master/doc/design/subscription-config.md

For the moment, we can only assign empty value to env var.

exdx commented 3 years ago

HI @abouchama, if I understand correctly you're looking to not have OLM inject env variables when installing the operator -- do you have access to the subscriptions? You could patch the subscription to remove the config portion of the spec and then remove the CSV (which will remove the operator), which would trigger the subscription to create a new CSV without the corresponding env variables.

awgreene commented 3 years ago

@abouchama could you please provide additional information / the steps to reproduce the error?

From my interpretation of your report, it seems as though you have a CSV that includes an environment variable that you wish to remove entirely from the CSV using the subscription config. This is not currently supported by OLM.

abouchama commented 3 years ago

Hello @awgreene , @exdx ,, Once we set environment variables as Openshift cluster global. the operator sets the same environment variables on all the pods created by this operator.

The only solution to handle such situation is to unset those environment variables at the subscription level.

For the moment, we have only the way to override/change the value of an existing env var or to add a new env vars.