com.avito.k8s.PodCollectionExtensions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kubernetes Show documentation
Show all versions of kubernetes Show documentation
Collection of infrastructure libraries and gradle plugins of Avito Android project
package com.avito.k8s
import com.avito.k8s.model.KubePod
public fun Collection.describePods(deploymentName: String): String {
val pods = this
return buildString {
appendLine("Getting pods for deployment: $deploymentName:")
appendLine("----------------")
pods.forEach { pod -> appendLine(pod.toString()) }
val runningCount = pods.count { it.phase == KubePod.PodPhase.Running }
val pendingCount = pods.count { it.phase is KubePod.PodPhase.Pending }
val otherCount = pods.size - runningCount - pendingCount
append(
"------- Summary: " +
"running: $runningCount; " +
"pending: $pendingCount; " +
"other $otherCount ---------"
)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy