Skip to content

Commit

Permalink
chore: fix hardcoded namespace (#14871)
Browse files Browse the repository at this point in the history
  • Loading branch information
keyihuang committed Dec 19, 2024
1 parent 8bec679 commit 4d3d502
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,12 @@ open class DiagnosticToolHandler(

private fun collectPodInfo(client: KubernetesClient): List<Map<String, Any>> {
logger.info { "Collecting pods data..." }
val currentNamespace = client.namespace
logger.info { "Current namespace from client: $currentNamespace" }
val pods =
client
.pods()
?.inNamespace("ab")
?.inNamespace(currentNamespace)
?.list()
?.items ?: emptyList()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ private fun mockDiagnosticToolHandler(): DiagnosticToolHandler {
}

val podList = PodList().apply { items = listOf(pod) }

every { kubernetesClient.namespace } returns "ab"
every { kubernetesClient.pods() } returns
mockk {
every { inNamespace("ab") } returns
Expand Down

0 comments on commit 4d3d502

Please sign in to comment.