mirror of https://github.com/k3s-io/k3s
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 ```NONEpull/6/head
commit
91d8c41147
File diff suppressed because it is too large
Load Diff
|
@ -363,7 +363,8 @@ func TestDescribeContainers(t *testing.T) {
|
|||
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()
|
||||
for _, expected := range testCase.expectedElements {
|
||||
if !strings.Contains(output, expected) {
|
||||
|
|
Loading…
Reference in New Issue