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

Commit

Permalink
bind the env var to the application.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaTP committed Aug 30, 2021
1 parent 2ddddef commit c7e5386
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions core/cloudflow-operator/src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ cloudflow {
flink-enabled = true
spark-enabled = true

controlled-namespace = ${?CONTROLLED_NAMESPACE}

api {
# API version for client compatibility checks
compatibility-version = "1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import com.typesafe.config._
import io.fabric8.kubernetes.api.model.Quantity

import scala.io.{ BufferedSource, Source }
import scala.util.{ Success, Try }
import scala.util.Try

object Settings extends ExtensionId[Settings] with ExtensionIdProvider {
override def lookup = Settings
Expand Down Expand Up @@ -132,10 +132,7 @@ 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 {
case Success(str) if !str.trim.isEmpty => Some(str)
case _ => None
}
val controlledNamespace = Try(config.getString(s"$root.controlled-namespace")).toOption

val api = ApiSettings(getNonEmptyString(config, s"$root.api.bind-interface"), getPort(config, s"$root.api.bind-port"))

Expand Down

0 comments on commit c7e5386

Please sign in to comment.