Merge pull request #21203 from timstclair/summary-api

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot 2016-02-12 17:06:15 -08:00
commit 4c60a23204

View File

@ -120,7 +120,6 @@ var _ = Describe("Kubelet", func() {
It("it should report resource usage through the stats api", func() {
By("Returning stats summary")
resp, err := http.Get(*kubeletAddress + "/stats/summary")
now := time.Now()
Expect(err).To(BeNil(), fmt.Sprintf("Failed to get /stats/summary"))
summary := stats.Summary{}
contentsBytes, err := ioutil.ReadAll(resp.Body)
@ -130,9 +129,6 @@ var _ = Describe("Kubelet", func() {
err = decoder.Decode(&summary)
Expect(err).To(BeNil(), fmt.Sprintf("Failed to parse /stats/summary to go struct: %+v", resp))
By("Having the correct time")
Expect(summary.Time.Time).To(BeTemporally("~", now, 20*time.Second))
By("Having resources for node")
Expect(summary.Node.NodeName).To(Equal(*nodeName))
Expect(summary.Node.CPU.UsageCoreNanoSeconds).NotTo(BeNil())