operator-framework / operator-lifecycle-manager

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

Subscription config doesn't support envFrom, but it is claimed in the document. #1947

Open horis233 opened 3 years ago

horis233 commented 3 years ago

Bug Report

We claimed subscription config supports the envForm in the doc https://github.com/operator-framework/operator-lifecycle-manager/blob/master/doc/design/subscription-config.md#envfrom, but it doesn't.

What did you do? A clear and concise description of the steps you took (or insert a code snippet).

Add an envFrom into the Subscription config.

What did you expect to see? A clear and concise description of what you expected to happen (or insert a code snippet).

The envFrom is inherited by the operator deployments.

What did you see instead? Under which circumstances? A clear and concise description of what you expected to happen (or insert a code snippet).

It doesn't exist in operator deployments.

Environment

clamoriniere commented 2 years ago

Hi @horis233 I was experimenting the same issue that you with envFrom that is not taken into account by the OLM controller.

After investigating the OLM Subscription resource. I think a better way is to use the spec.config.env option because you can also reference a configmap or a secret and it provide a more granular configuration (use a key different from the envvar name).

For example:

spec:
  config:
    env:
      - name: DD_API_KEY
        valueFrom:
          secretKeyRef: 
            key: api-key
            name: my-secret