From 6acd6c9d63e3e7bcca6275033ed8771d6485fcf4 Mon Sep 17 00:00:00 2001 From: Rob Scott Date: Sun, 3 Feb 2019 23:06:05 -0500 Subject: [PATCH] bumping version to 0.1.1, readme update --- README.md | 3 +++ pkg/capacity/resources.go | 4 ++-- pkg/cmd/version.go | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1619c87e..57c1c315 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,9 @@ example-node-2 tiller tiller-deploy 140m (14%) 180m (18%) It's worth noting that utilization numbers from pods will likely not add up to the total node utilization numbers. Unlike request and limit numbers where node and cluster level numbers represent a sum of pod values, node metrics come directly from metrics-server and will likely include other forms of resource utilization. +## Kubernetes Configuration +If a `KUBECONFIG` environment variable is specified, rbac-lookup will attempt to use the config at that path, otherwise it will default to `~/.kube/config`. + ## Similar Projects There are already some great projects out there that have similar goals. diff --git a/pkg/capacity/resources.go b/pkg/capacity/resources.go index 061c2656..31bc439a 100644 --- a/pkg/capacity/resources.go +++ b/pkg/capacity/resources.go @@ -110,9 +110,9 @@ func resourceString(actual, allocatable resource.Quantity, resourceType string) if allocatable.MilliValue() > 0 { utilPercent = float64(actual.MilliValue()) / float64(allocatable.MilliValue()) * 100 } + if resourceType == "cpu" { return fmt.Sprintf("%dm (%d%%)", actual.MilliValue(), int64(utilPercent)) - } else { - return fmt.Sprintf("%dMi (%d%%)", actual.Value()/1048576, int64(utilPercent)) } + return fmt.Sprintf("%dMi (%d%%)", actual.Value()/1048576, int64(utilPercent)) } diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go index 767de696..1a4e186c 100644 --- a/pkg/cmd/version.go +++ b/pkg/cmd/version.go @@ -28,6 +28,6 @@ var versionCmd = &cobra.Command{ Use: "version", Short: "Print the version number of kube-capacity", Run: func(cmd *cobra.Command, args []string) { - fmt.Println("kube-capacity version 0.1.0") + fmt.Println("kube-capacity version 0.1.1") }, }