Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Option for the operator to control a single namespace #1094

Merged
merged 2 commits into from
Aug 30, 2021
Merged

Conversation

andreaTP
Copy link
Contributor

@@ -131,6 +132,11 @@ final case class Settings(config: Config) extends Extension {
val flinkEnabled = config.getBoolean(s"$root.flink-enabled")
val sparkEnabled = config.getBoolean(s"$root.spark-enabled")

lazy val controlledNamespace: Option[String] = Try(sys.env("CONTROLLED_NAMESPACE")) match {
Copy link
Contributor

Choose a reason for hiding this comment

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

what about getting it from config and adding a default in the config lie we do in other places?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can, but, in this specific case, I decided to use an env variable to make it easier and clean in the helm chart.
e.g. https://github.com/lightbend/cloudflow-helm-charts/pull/23/files#diff-08bec0d8da17f5482f6840b57e144767f8250cafd31b80a37e13e494d2236b71R5

Having the default config would require some additional logic to be implemented there.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

Copy link
Contributor

@RayRoestenburg RayRoestenburg Aug 30, 2021

Choose a reason for hiding this comment

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

(the env var could have been used in the reference.conf as ${?VAR} so it is known what is used, but this is also in the code so it does not really matter)

Copy link
Contributor

Choose a reason for hiding this comment

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

(I guess I'm thinking of this as, the reference.conf tells me what can be configured, or which env props can be used to change things, but this is a minor detail)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree that would be nicer, I'll bind it to the operator configuration 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!

@RayRoestenburg RayRoestenburg self-requested a review August 30, 2021 14:26
@andreaTP andreaTP merged commit 3767c21 into main Aug 30, 2021
@andreaTP andreaTP deleted the single-namespace branch August 30, 2021 16:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants