mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #37856 from timstclair/summary-test
Automatic merge from submit-queue (batch tested with PRs 37692, 37785, 37647, 37941, 37856) Verify misc container in summary test Should detect issue from https://github.com/kubernetes/kubernetes/issues/35214, https://github.com/kubernetes/kubernetes/issues/37453 /cc @piosz @dchen1107
This commit is contained in:
commit
9f66f7544b
@ -103,6 +103,7 @@ go_test(
|
||||
"//test/e2e_node/services:go_default_library",
|
||||
"//test/e2e_node/system:go_default_library",
|
||||
"//test/utils:go_default_library",
|
||||
"//vendor:github.com/coreos/go-systemd/util",
|
||||
"//vendor:github.com/davecgh/go-spew/spew",
|
||||
"//vendor:github.com/golang/glog",
|
||||
"//vendor:github.com/kardianos/osext",
|
||||
|
@ -26,6 +26,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/stats"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
|
||||
systemdutil "github.com/coreos/go-systemd/util"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
"github.com/onsi/gomega/gstruct"
|
||||
@ -83,6 +84,15 @@ var _ = framework.KubeDescribe("Summary API", func() {
|
||||
"Logs": BeNil(),
|
||||
"UserDefinedMetrics": BeEmpty(),
|
||||
})
|
||||
systemContainers := gstruct.Elements{
|
||||
"kubelet": sysContExpectations,
|
||||
"runtime": sysContExpectations,
|
||||
}
|
||||
// The Kubelet only manages the 'misc' system container if the host is not running systemd.
|
||||
if !systemdutil.IsRunningSystemd() {
|
||||
framework.Logf("Host not running systemd; expecting 'misc' system container.")
|
||||
systemContainers["misc"] = sysContExpectations
|
||||
}
|
||||
// Expectations for pods.
|
||||
podExpectations := gstruct.MatchAllFields(gstruct.Fields{
|
||||
"PodRef": gstruct.Ignore(),
|
||||
@ -147,12 +157,9 @@ var _ = framework.KubeDescribe("Summary API", func() {
|
||||
})
|
||||
matchExpectations := ptrMatchAllFields(gstruct.Fields{
|
||||
"Node": gstruct.MatchAllFields(gstruct.Fields{
|
||||
"NodeName": Equal(framework.TestContext.NodeName),
|
||||
"StartTime": recent(maxStartAge),
|
||||
"SystemContainers": gstruct.MatchElements(summaryObjectID, gstruct.IgnoreExtras, gstruct.Elements{
|
||||
"kubelet": sysContExpectations,
|
||||
"runtime": sysContExpectations,
|
||||
}),
|
||||
"NodeName": Equal(framework.TestContext.NodeName),
|
||||
"StartTime": recent(maxStartAge),
|
||||
"SystemContainers": gstruct.MatchAllElements(summaryObjectID, systemContainers),
|
||||
"CPU": ptrMatchAllFields(gstruct.Fields{
|
||||
"Time": recent(maxStatsAge),
|
||||
"UsageNanoCores": bounded(100E3, 2E9),
|
||||
|
Loading…
Reference in New Issue
Block a user