mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
fix kubectl describe pod, show tolerationSeconds
This commit is contained in:
parent
bf984aa328
commit
49072c810a
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user