Skip to content

Commit

Permalink
Update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
CatherineF-dev committed Apr 24, 2024
1 parent 56c93e8 commit 572db32
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ func (p *CoreProvider) GetNodeMetrics(nodes ...*corev1.Node) ([]metrics.NodeMetr
return resMetrics, nil
}

// Wrapping this method with the new GetPodMetrics for easily re-using the old unit test and a quick merge for the vulnerability fix. In the long run it's still better to directly updating this with the new API without another layer of wrap.
//
// If metrics from i-th pod are not present, ContainerMetrics[i] will be nil and TimeInfo[i] will be default TimeInfo value.
func (p *CoreProvider) getPodMetrics(pods ...apitypes.NamespacedName) ([]api.TimeInfo, [][]metrics.ContainerMetrics, error) {
timeInfo := make([]api.TimeInfo, len(pods))
Expand Down Expand Up @@ -183,6 +185,8 @@ func (p *CoreProvider) getPodMetrics(pods ...apitypes.NamespacedName) ([]api.Tim
return timeInfo, coreMetrics, nil
}

// Wrapping this method with the new GetPodMetrics for easily re-using the old unit test and a quick merge for the vulnerability fix. In the long run it's still better to directly updating this with the new API without another layer of wrap.
//
// If metrics from i-th node are not present, ResourceList[i] will be nil and TimeInfo[i] will be default TimeInfo value.
func (p *CoreProvider) getNodeMetrics(nodes ...string) ([]api.TimeInfo, []corev1.ResourceList, error) {
timeInfo := make([]api.TimeInfo, len(nodes))
Expand Down

0 comments on commit 572db32

Please sign in to comment.