Skip to content

Conversation

@bharatnpti
Copy link

Fixes #54

Add configuration flag to make canary releases optional

object SubsetProvider {

private val canaryReleaseEnabled: Boolean by lazy {
val envValue = System.getenv("LMOS_OPERATOR_CANARY_RELEASE_ENABLED")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@pschwager pschwager force-pushed the main branch 2 times, most recently from ae51811 to 93051ac Compare September 10, 2025 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make Canary Releases Optional in LMOS-Operator

3 participants