Change group for pod-state check to workload-health

varsha/versions
Varsha Varadarajan 2019-06-20 15:28:24 -04:00
parent 4a3e055e13
commit 500858d2d1
2 changed files with 4 additions and 17 deletions

View File

@ -21,7 +21,7 @@ func (p *podStatusCheck) Name() string {
// Groups returns a list of group names this check should be part of.
func (p *podStatusCheck) Groups() []string {
return []string{"basic"}
return []string{"workload-health"}
}
// Description returns a detailed human-readable description of what this check

View File

@ -7,14 +7,13 @@ import (
"github.com/digitalocean/clusterlint/kube"
"github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func TestMeta(t *testing.T) {
podStatusCheck := podStatusCheck{}
assert.Equal(t, "pod-state", podStatusCheck.Name())
assert.Equal(t, "Check if there are unhealthy pods in the cluster", podStatusCheck.Description())
assert.Equal(t, []string{"basic"}, podStatusCheck.Groups())
assert.Equal(t, []string{"workload-health"}, podStatusCheck.Groups())
}
func TestPodStateError(t *testing.T) {
@ -71,22 +70,10 @@ func TestPodStateError(t *testing.T) {
}
}
func initPod() *kube.Objects {
objs := &kube.Objects{
Pods: &corev1.PodList{},
}
return objs
}
func status(status corev1.PodPhase) *kube.Objects {
objs := initPod()
objs.Pods = &corev1.PodList{
Items: []corev1.Pod{
{
ObjectMeta: metav1.ObjectMeta{Name: "pod_foo", Namespace: "k8s"},
Status: corev1.PodStatus{Phase: status},
},
},
objs.Pods.Items[0].Status = corev1.PodStatus{
Phase: status,
}
return objs
}