Skip to content

Commit

Permalink
fix: ensure correct format of memoryLimit in workspace config
Browse files Browse the repository at this point in the history
  • Loading branch information
slisson committed Feb 11, 2025
1 parent 6e0658a commit 24efa2d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import io.ktor.server.routing.post
import io.ktor.server.routing.route
import io.ktor.server.routing.routing
import io.ktor.util.encodeBase64
import io.kubernetes.client.custom.Quantity
import kotlinx.html.DIV
import kotlinx.html.FlowOrInteractiveOrPhrasingContent
import kotlinx.html.FormEncType
Expand Down Expand Up @@ -1233,8 +1234,11 @@ suspend fun ApplicationCall.respondTarGz(body: (TarArchiveOutputStream) -> Unit)

fun sanitizeReceivedWorkspaceConfig(receivedWorkspaceConfig: Workspace, existingWorkspaceConfig: Workspace): Workspace =
mergeMaskedCredentialsWithPreviousCredentials(receivedWorkspaceConfig, existingWorkspaceConfig)
// set ID just in case the user copy-pastes a workspace and forgets to change the ID
.copy(id = existingWorkspaceConfig.id)
.copy(
// set ID just in case the user copy-pastes a workspace and forgets to change the ID
id = existingWorkspaceConfig.id,
memoryLimit = Quantity(receivedWorkspaceConfig.memoryLimit).toSuffixedString(),
)

const val MASKED_CREDENTIAL_VALUE = "••••••••"

Expand Down

0 comments on commit 24efa2d

Please # to comment.