feat: Add configuration flag to make canary releases optional in LMOS…#62
feat: Add configuration flag to make canary releases optional in LMOS…#62bharatnpti wants to merge 1 commit into
Conversation
…-Operator: Fixes #54
| object SubsetProvider { | ||
|
|
||
| private val canaryReleaseEnabled: Boolean by lazy { | ||
| val envValue = System.getenv("LMOS_OPERATOR_CANARY_RELEASE_ENABLED") |
There was a problem hiding this comment.
As the lmos-operator is built using spring boot, I asked myself whether we could (and should) use spring boot's configuration to inject the "canaryReleaseEnabled" flag (instead of bypassing spring boot and reading from system environment directly).
I see that it is currently not immediately possible, because the SubsetProvider is used by the ChannelDependentResource (via the RoutingChannelGenerator), and the ChannelDependentResource is currently not managed by spring. But if we marked it as a @Component, we could inject the flag via spring boot?
| @GetMapping("/channels") | ||
| fun getChannels( | ||
| @RequestHeader(name = X_SUBSET_HEADER) subsetHeader: String, | ||
| @RequestHeader(name = X_SUBSET_HEADER, required = false) subsetHeader: String, |
There was a problem hiding this comment.
If we set required to false, should we also change the type of subsetHeaderto String? to make it nullable? Or will spring somehow take care that we don't get a NPE here?
ae51811 to
93051ac
Compare
Fixes #54
Add configuration flag to make canary releases optional