Commit 49072c81 authored by Kevin's avatar Kevin

fix kubectl describe pod, show tolerationSeconds

parent bf984aa3
......@@ -2893,6 +2893,9 @@ func printTolerationsMultilineWithIndent(w *PrefixWriter, initialIndent, title,
if len(toleration.Effect) != 0 {
w.Write(LEVEL_0, ":%s", toleration.Effect)
}
if toleration.TolerationSeconds != nil {
w.Write(LEVEL_0, " for %ds", *toleration.TolerationSeconds)
}
w.Write(LEVEL_0, "\n")
i++
}
......
......@@ -78,7 +78,7 @@ func TestDescribePodTolerations(t *testing.T) {
Spec: api.PodSpec{
Tolerations: []api.Toleration{
{Key: "key1", Value: "value1"},
{Key: "key2", Value: "value2"},
{Key: "key2", Value: "value2", Effect: api.TaintEffectNoExecute, TolerationSeconds: &[]int64{300}[0]},
},
},
})
......@@ -88,7 +88,7 @@ func TestDescribePodTolerations(t *testing.T) {
if err != nil {
t.Errorf("unexpected error: %v", err)
}
if !strings.Contains(out, "key1=value1") || !strings.Contains(out, "key2=value2") || !strings.Contains(out, "Tolerations:") {
if !strings.Contains(out, "key1=value1") || !strings.Contains(out, "key2=value2:NoExecute for 300s") || !strings.Contains(out, "Tolerations:") {
t.Errorf("unexpected out: %s", out)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment