mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-02-14 18:29:53 +00:00
Collector and analyzer for sysctl parameters (#441)
Collector and analyzer for sysctl parameters
This commit is contained in:
21
pkg/k8sutil/node.go
Normal file
21
pkg/k8sutil/node.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package k8sutil
|
||||
|
||||
import v1 "k8s.io/api/core/v1"
|
||||
|
||||
const UnreachableTaint = "node.kubernetes.io/unreachable"
|
||||
const NotReadyTaint = "node.kubernetes.io/not-ready"
|
||||
const UnschedulableTaint = "node.kubernetes.io/unschedulable"
|
||||
|
||||
func NodeIsReady(node v1.Node) bool {
|
||||
for _, taint := range node.Spec.Taints {
|
||||
switch taint.Key {
|
||||
case NotReadyTaint:
|
||||
return false
|
||||
case UnreachableTaint:
|
||||
return false
|
||||
case UnschedulableTaint:
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user