From 93bbdf271595acdfc9e18c9a5e56c685842ce216 Mon Sep 17 00:00:00 2001 From: Yonghao Yu Date: Mon, 24 Jun 2024 13:09:23 -0400 Subject: [PATCH] draft office suite --- .../dsde/workbench/leonardo/kubernetesModels.scala | 4 ++-- .../dsde/workbench/leonardo/kubernetesModelsSpec.scala | 2 +- .../workbench/leonardo/http/service/LeoAppServiceInterp.scala | 4 ++-- .../leonardo/monitor/LeoPubsubMessageSubscriber.scala | 2 +- .../dsde/workbench/leonardo/util/BuildHelmChartValues.scala | 2 +- .../workbench/leonardo/util/BuildHelmChartValuesSpec.scala | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/kubernetesModels.scala b/core/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/kubernetesModels.scala index 9edb120cf4a..72a0ff37c36 100644 --- a/core/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/kubernetesModels.scala +++ b/core/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/kubernetesModels.scala @@ -323,7 +323,7 @@ object AllowedChartName { def asString: String = "sas" } - final case object OfficeSuite extends AllowedChartName { + final case object Officesuite extends AllowedChartName { def asString: String = "Officesuite" } @@ -331,7 +331,7 @@ object AllowedChartName { private val deprecatedName: Map[String, AllowedChartName] = Map( "aou-rstudio-chart" -> RStudio, "aou-sas-chart" -> Sas, - "aou-officesuite-chart" -> OfficeSuite + "aou-officesuite-chart" -> Officesuite ) def stringToObject: Map[String, AllowedChartName] = diff --git a/core/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/kubernetesModelsSpec.scala b/core/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/kubernetesModelsSpec.scala index b63e6e6cb45..0dcd544f236 100644 --- a/core/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/kubernetesModelsSpec.scala +++ b/core/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/kubernetesModelsSpec.scala @@ -8,7 +8,7 @@ class kubernetesModelsSpec extends LeonardoTestSuite with Matchers with AnyFlatS it should "convert chartName to AllowedChartName correctly" in { AllowedChartName.fromChartName(ChartName("/leonardo/cromwell")) shouldBe None AllowedChartName.fromChartName(ChartName("/leonardo/sas")) shouldBe Some(AllowedChartName.Sas) - AllowedChartName.fromChartName(ChartName("/leonardo/officesuite")) shouldBe Some(AllowedChartName.OFFICESUITE) + AllowedChartName.fromChartName(ChartName("/leonardo/officesuite")) shouldBe Some(AllowedChartName.Officesuite) AllowedChartName.fromChartName(ChartName("/leonardo/rstudio")) shouldBe Some( AllowedChartName.RStudio ) diff --git a/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/http/service/LeoAppServiceInterp.scala b/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/http/service/LeoAppServiceInterp.scala index 6b8c6bc25d6..ffaaa5801e1 100644 --- a/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/http/service/LeoAppServiceInterp.scala +++ b/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/http/service/LeoAppServiceInterp.scala @@ -106,7 +106,7 @@ final class LeoAppServiceInterp[F[_]: Parallel](config: AppServiceConfig, case Some(cn) => cn match { case AllowedChartName.RStudio => F.unit - case AllowedChartName.OfficeSuite => F.unit + case AllowedChartName.Officesuite => F.unit case AllowedChartName.Sas => if (config.enableSasApp) { if (enableIntraNodeVisibility) { @@ -1465,7 +1465,7 @@ final class LeoAppServiceInterp[F[_]: Parallel](config: AppServiceConfig, val chartVersion = req.allowedChartName.get match { case AllowedChartName.RStudio => config.leoKubernetesConfig.allowedAppConfig.rstudioChartVersion case AllowedChartName.Sas => config.leoKubernetesConfig.allowedAppConfig.sasChartVersion - case AllowedChartName.OfficeSuite => config.leoKubernetesConfig.allowedAppConfig.officeSuiteChartVersion + case AllowedChartName.Officesuite => config.leoKubernetesConfig.allowedAppConfig.officeSuiteChartVersion } gkeAppConfig.chart .lens(_.name) diff --git a/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/monitor/LeoPubsubMessageSubscriber.scala b/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/monitor/LeoPubsubMessageSubscriber.scala index bb828c7ac74..ea0e71636aa 100644 --- a/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/monitor/LeoPubsubMessageSubscriber.scala +++ b/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/monitor/LeoPubsubMessageSubscriber.scala @@ -1505,7 +1505,7 @@ class LeoPubsubMessageSubscriber[F[_]]( latestAppChartVersion <- KubernetesAppConfig.configForTypeAndCloud(appResult.app.appType, msg.cloudContext.cloudProvider ) match { - case Some(AllowedAppConfig(_, rstudioChartVersion, sasChartVersion, _, _, _, _, _, _, _)) => + case Some(AllowedAppConfig(_, rstudioChartVersion, sasChartVersion, officesuiteChartVersion, _, _, _, _, _, _, _)) => AllowedChartName.fromChartName(appResult.app.chart.name) match { case Some(AllowedChartName.RStudio) => F.pure(rstudioChartVersion) diff --git a/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/BuildHelmChartValues.scala b/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/BuildHelmChartValues.scala index 3cd3cc0780f..ca488b4a918 100644 --- a/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/BuildHelmChartValues.scala +++ b/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/BuildHelmChartValues.scala @@ -343,7 +343,7 @@ private[leonardo] object BuildHelmChartValues { raw"""imageCredentials.password=${config.allowedAppConfig.sasContainerRegistryCredentials.password.asString}""" ) ++ common - case AllowedChartName.OfficeSuite => + case AllowedChartName.Officesuite => List( raw"""ingress.officesuite.path=${ingressPath}${"(/|$)(.*)"}""", raw"""ingress.welder.path=${welderIngressPath}${"(/|$)(.*)"}""", diff --git a/http/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/util/BuildHelmChartValuesSpec.scala b/http/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/util/BuildHelmChartValuesSpec.scala index 21d93af619f..de4213596ef 100644 --- a/http/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/util/BuildHelmChartValuesSpec.scala +++ b/http/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/util/BuildHelmChartValuesSpec.scala @@ -400,7 +400,7 @@ class BuildHelmChartValuesSpec extends AnyFlatSpecLike with LeonardoTestSuite { val envVariables = Map("WORKSPACE_NAME" -> "test-workspace-name") val res = buildAllowedAppChartOverrideValuesString( Config.gkeInterpConfig, - AllowedChartName.OfficeSuite, + AllowedChartName.Officesuite, appName = AppName("app1"), cluster = savedCluster1, nodepoolName = Some(NodepoolName("pool1")),