Modify apimachinery,apps,instrumentation tests to import framework/log

This is part of the transition to using framework/log instead
of the Logf inside the framework package. This will help with
import size/cycles when importing the framework or subpackages
This commit is contained in:
hui luo
2019-05-03 15:12:20 -07:00
parent 71bbabc36b
commit 4d4e4f4056
42 changed files with 321 additions and 280 deletions

View File

@@ -24,6 +24,7 @@ import (
"k8s.io/apimachinery/pkg/labels"
api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/test/e2e/framework"
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
"k8s.io/utils/integer"
)
@@ -67,13 +68,13 @@ func EnsureLoggingAgentRestartsCount(f *framework.Framework, appName string, max
for _, pod := range agentPods.Items {
contStatuses := pod.Status.ContainerStatuses
if len(contStatuses) == 0 {
framework.Logf("There are no container statuses for pod %s", pod.Name)
e2elog.Logf("There are no container statuses for pod %s", pod.Name)
continue
}
restartCount := int(contStatuses[0].RestartCount)
maxRestartCount = integer.IntMax(maxRestartCount, restartCount)
framework.Logf("Logging agent %s on node %s was restarted %d times",
e2elog.Logf("Logging agent %s on node %s was restarted %d times",
pod.Name, pod.Spec.NodeName, restartCount)
}