Skip to content

Commit

Permalink
keep params as is until we fix disk and apps too
Browse files Browse the repository at this point in the history
  • Loading branch information
LizBaldo committed Feb 11, 2025
1 parent b21ec87 commit 0c82d92
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ trait LeonardoTestUtils
implicit val patienceConfig: PatienceConfig = clusterPatience
eventually {
val allStatus: Set[ClusterStatus] = Leonardo.cluster
.listIncludingDeletedRuntime(googleProject)
.listRuntime(googleProject)
.filter(c => c.runtimeName == runtimeName && c.googleProject == googleProject)
.map(_.status)
.toSet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class RuntimeServiceInterp[F[_]: Parallel](

samResources <- samService.listResources(userInfo.accessToken.token, RuntimeSamResource.resourceType)

(labelMap, _) <- F.fromEither(processListParameters(params))
(labelMap, _, _) <- F.fromEither(processListParameters(params))
excludeStatuses = List(RuntimeStatus.Deleted)
creatorOnly <- F.fromEither(processCreatorOnlyParameter(userInfo.userEmail, params, ctx.traceId))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ class RuntimeV2ServiceInterp[F[_]: Parallel](
ctx <- as.ask

// Parameters: parse search filters from request
(labelMap, _) <- F.fromEither(processListParameters(params))
(labelMap, _, _) <- F.fromEither(processListParameters(params))
excludeStatuses = List(RuntimeStatus.Deleted)
creatorEmail <- F.fromEither(processCreatorOnlyParameter(userInfo.userEmail, params, ctx.traceId))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,26 @@ package object service {

private[service] def processListParameters(
params: LabelMap
): Either[ParseLabelsException, (LabelMap, List[String])] =
): Either[ParseLabelsException, (LabelMap, Boolean, List[String])] =
// returns a tuple made of three elements:
// 1) LabelMap - represents the labels to filter the request by
// 2) includeDeleted - Boolean which determines if we include deleted resources in the response
// 3) includeLabels - List of label keys which represent the labels (key, value pairs) that will be returned in response
// Note that optional parameter `role` or `creator` (represented by creatorOnlyKey and creatorOnlyValue) is omitted.
for {
labelMap <- processLabelMap(params - includeLabelsKey - creatorOnlyKey - creatorOnlyValue)
labelMap <- processLabelMap(params - includeDeletedKey - includeLabelsKey - creatorOnlyKey - creatorOnlyValue)
includeDeleted = params.get(includeDeletedKey) match {
case Some(includeDeletedValue) =>
if (includeDeletedValue.toLowerCase == "true")
true
else false
case None => false
}
includeLabels <- params.get(includeLabelsKey) match {
case Some(includeLabelsValue) => processLabelsToReturn(includeLabelsValue)
case None => Either.right(List.empty[String])
}
} yield (labelMap, includeLabels)
} yield (labelMap, includeDeleted, includeLabels)

/**
* Top-level query string parameter for apps and disks: GET /api/apps?includeLabels=foo,bar
Expand Down

0 comments on commit 0c82d92

Please sign in to comment.