From 76249528703ce650d7d5f596a9418d7a98a4ef86 Mon Sep 17 00:00:00 2001 From: Frederic Branczyk Date: Thu, 13 Dec 2018 15:50:02 -0800 Subject: [PATCH] resourceprovider: Add comments on possible nil results --- pkg/resourceprovider/provider.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/resourceprovider/provider.go b/pkg/resourceprovider/provider.go index 7dda77937..b1dc0151d 100644 --- a/pkg/resourceprovider/provider.go +++ b/pkg/resourceprovider/provider.go @@ -118,6 +118,7 @@ type nsQueryResults struct { err error } +// GetContainerMetrics implements the provider.MetricsProvider interface. It may return nil, nil, nil. func (p *resourceProvider) GetContainerMetrics(pods ...apitypes.NamespacedName) ([]provider.TimeInfo, [][]metrics.ContainerMetrics, error) { if len(pods) == 0 { return nil, nil, nil @@ -238,6 +239,7 @@ func (p *resourceProvider) assignForPod(pod apitypes.NamespacedName, resultsByNs *resMetrics = containerMetricsList } +// GetNodeMetrics implements the provider.MetricsProvider interface. It may return nil, nil, nil. func (p *resourceProvider) GetNodeMetrics(nodes ...string) ([]provider.TimeInfo, []corev1.ResourceList, error) { if len(nodes) == 0 { return nil, nil, nil