Skip to content

Commit

Permalink
resourceprovider: Add comments on possible nil results
Browse files Browse the repository at this point in the history
  • Loading branch information
brancz committed Dec 13, 2018
1 parent e9ef0bb commit 7624952
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/resourceprovider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7624952

Please sign in to comment.