if !masterRegistered { framework.Logf("Master is node api.Registry. Skipping testing Scheduler metrics.") return } response, err := grabber.GrabFromScheduler() framework.ExpectNoError(err) Expect(response).NotTo(BeEmpty()) }) It("should grab all metrics from a ControllerManager.", func() { By("Proxying to Pod through the API server") // Check if master Node is registered nodes, err := c.Core().Nodes().List(v1.ListOptions{}) framework.ExpectNoError(err) var masterRegistered = false for _, node := range nodes.Items { if strings.HasSuffix(node.Name, "master") { masterRegistered = true } } if !masterRegistered { framework.Logf("Master is node api.Registry. Skipping testing ControllerManager metrics.") return } response, err := grabber.GrabFromControllerManager() framework.ExpectNoError(err) Expect(response).NotTo(BeEmpty()) }) })
framework.ExpectNoError(err) Expect(unknownMetrics).To(BeEmpty()) checkMetrics(metrics.Metrics(response), metrics.KnownSchedulerMetrics) }) It("should grab all metrics from a ControllerManager.", func() { By("Proxying to Pod through the API server") // Check if master Node is registered nodes, err := c.Nodes().List(api.ListOptions{}) framework.ExpectNoError(err) var masterRegistered = false for _, node := range nodes.Items { if strings.HasSuffix(node.Name, "master") { masterRegistered = true } } if !masterRegistered { framework.Logf("Master is node registered. Skipping testing ControllerManager metrics.") return } unknownMetrics := sets.NewString() response, err := grabber.GrabFromControllerManager(unknownMetrics) framework.ExpectNoError(err) Expect(unknownMetrics).To(BeEmpty()) checkMetrics(metrics.Metrics(response), metrics.KnownControllerManagerMetrics) }) })