Commit 91d8c411 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #36732 from oulinbao/refactor_describe_containers

Automatic merge from submit-queue Refactor describe.go with PrefixWriter **What this PR does / why we need it**: refactor describeContainers function and decrease gocyclo result **Special notes for your reviewer**: the new PR for 36032 https://github.com/kubernetes/kubernetes/pull/36032 **Release note**: ```release-note ```NONE
parents 238ffdd0 0b74fa12
...@@ -363,7 +363,8 @@ func TestDescribeContainers(t *testing.T) { ...@@ -363,7 +363,8 @@ func TestDescribeContainers(t *testing.T) {
ContainerStatuses: []api.ContainerStatus{testCase.status}, ContainerStatuses: []api.ContainerStatus{testCase.status},
}, },
} }
describeContainers("Containers", pod.Spec.Containers, pod.Status.ContainerStatuses, EnvValueRetriever(&pod), out, "") writer := &PrefixWriter{out}
describeContainers("Containers", pod.Spec.Containers, pod.Status.ContainerStatuses, EnvValueRetriever(&pod), writer, "")
output := out.String() output := out.String()
for _, expected := range testCase.expectedElements { for _, expected := range testCase.expectedElements {
if !strings.Contains(output, expected) { if !strings.Contains(output, expected) {
......
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