open-feature / open-feature-operator

A Kubernetes feature flag operator
https://openfeature.dev
Apache License 2.0
181 stars 35 forks source link

[BUG] InProcessConfiguration not injecting env-vars if set to default #646

Closed toddbaert closed 4 months ago

toddbaert commented 4 months ago

If I set an InProcessConfiguration like this:

apiVersion: core.openfeature.dev/v1beta1
kind: InProcessConfiguration
metadata:
    name: in-process-config
spec:
    host: flagd-standalone
    port: 8015

the resulting container looks like this (note FLAGD_PORT is missing):

image

If I change the port to something other than 8015 like this:

apiVersion: core.openfeature.dev/v1beta1
kind: InProcessConfiguration
metadata:
    name: in-process-config
spec:
    host: flagd-standalone
    port: 8033

Then the var is set (note FLAGD_PORT is now set to 8033 as expected):

image

thisthat commented 4 months ago

is this really a bug? If the port != than the default, do we really need to specify it? I'd see it as a chore/improvement more than a bug. In case, we would need to adapt this line here: https://github.com/open-feature/open-feature-operator/blob/main/apis/core/v1beta1/inprocessconfiguration_types.go#L162

toddbaert commented 4 months ago

The provider by default uses the RPC port (8013). If we don't inject a different FLAGD_PORT it will try to connect on that which doesn't work. We could alter all the providers to default to 8015 if the resolver is in-process, but as is, things don't line up, and the provider will try to use 8013 which is the RPC endpoint.