Skip to content

Commit

Permalink
Merge pull request #4 from robscott/rs/better-auth
Browse files Browse the repository at this point in the history
Adding More Auth Providers, Fixes for Certain Pod States
  • Loading branch information
robscott authored Feb 5, 2019
2 parents 34beab9 + ea17688 commit 737df46
Show file tree
Hide file tree
Showing 3,597 changed files with 3,267,527 additions and 11 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
157 changes: 155 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions pkg/capacity/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ func buildClusterMetric(podList *corev1.PodList, pmList *v1beta1.PodMetricsList,
}

for _, pod := range podList.Items {
cm.addPodMetric(&pod)
if pod.Status.Phase != corev1.PodSucceeded && pod.Status.Phase != corev1.PodFailed {
cm.addPodMetric(&pod)
}
}

for _, node := range nodeList.Items {
Expand All @@ -122,9 +124,11 @@ func buildClusterMetric(podList *corev1.PodList, pmList *v1beta1.PodMetricsList,

for _, pod := range pmList.Items {
pm := cm.podMetrics[fmt.Sprintf("%s-%s", pod.GetNamespace(), pod.GetName())]
for _, container := range pod.Containers {
pm.cpu.utilization.Add(container.Usage["cpu"])
pm.memory.utilization.Add(container.Usage["memory"])
if pm != nil {
for _, container := range pod.Containers {
pm.cpu.utilization.Add(container.Usage["cpu"])
pm.memory.utilization.Add(container.Usage["memory"])
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.2")
fmt.Println("kube-capacity version 0.1.3")
},
}
6 changes: 2 additions & 4 deletions pkg/kube/clientset.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ import (
"k8s.io/client-go/tools/clientcmd"
metrics "k8s.io/metrics/pkg/client/clientset/versioned"

// Required for GKE
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
// Required for OIDC
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
// Required for GKE, OIDC, and more
_ "k8s.io/client-go/plugin/pkg/client/auth"
)

// NewClientSet returns a new Kubernetes clientset
Expand Down
17 changes: 17 additions & 0 deletions vendor/contrib.go.opencensus.io/exporter/ocagent/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions vendor/contrib.go.opencensus.io/exporter/ocagent/CONTRIBUTING.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 737df46

Please sign in to comment.