Skip to content

Commit

Permalink
chore: Only request running pods from Kubernetes API (#1322)
Browse files Browse the repository at this point in the history
  • Loading branch information
leviramsey authored Sep 26, 2024
1 parent 555ed88 commit fb1e26f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ final class AzureRbacAksServiceDiscovery(implicit system: ExtendedActorSystem) e
val host = settings.apiServiceHost
val port = settings.apiServicePort
val path = Uri.Path.Empty / "api" / "v1" / "namespaces" / namespace / "pods"
val query = Uri.Query("labelSelector" -> labelSelector)
val query = Uri.Query("labelSelector" -> labelSelector, "fieldSelector" -> "status.phase==Running")
val uri = Uri.from(scheme = "https", host = host, port = port).withPath(path).withQuery(query)

Future(HttpRequest(uri = uri, headers = List(Authorization(OAuth2BearerToken(token)))))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class KubernetesApiServiceDiscovery(implicit system: ActorSystem) extends Servic
port <- Try(portStr.toInt).toOption
} yield {
val path = Uri.Path.Empty / "api" / "v1" / "namespaces" / namespace / "pods"
val query = Uri.Query("labelSelector" -> labelSelector)
val query = Uri.Query("labelSelector" -> labelSelector, "fieldSelection" -> "status.phase==Running")
val uri = Uri.from(scheme = "https", host = host, port = port).withPath(path).withQuery(query)

HttpRequest(uri = uri, headers = List(Authorization(OAuth2BearerToken(token))))
Expand Down

0 comments on commit fb1e26f

Please sign in to comment.