Skip to content

Commit

Permalink
Better resrouce formatting (flyteorg#313)
Browse files Browse the repository at this point in the history
Signed-off-by: Haytham Abuelfutuh <[email protected]>
  • Loading branch information
EngHabu authored Sep 13, 2021
1 parent 0efd3af commit e23b7c6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/controller/nodes/task/k8s/plugin_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,13 @@ func (e *PluginManager) getPodEffectiveResourceLimits(ctx context.Context, pod *
}
}

logger.Infof(ctx, "The resource requirement for creating Pod [%v/%v] is [%v]\n",
pod.Namespace, pod.Name, podRequestedResources)
formattedResources := make([]string, 0, len(podRequestedResources))
for resourceName, quantity := range podRequestedResources {
formattedResources = append(formattedResources, fmt.Sprintf("{[%v]: [%v]}", resourceName, quantity.String()))
}

logger.Infof(ctx, "The resource requirement for creating Pod [%v/%v] is [%+v]\n",
pod.Namespace, pod.Name, formattedResources)

return podRequestedResources
}
Expand Down

0 comments on commit e23b7c6

Please sign in to comment.