From 2672b6771f5d757f0ee7777c4aacb15757e8f40f Mon Sep 17 00:00:00 2001 From: Dave Konopka Date: Thu, 1 Aug 2019 11:32:50 -0400 Subject: [PATCH] Replace annotation with label for consistency with project --- README.md | 6 +++--- pkg/summary/summary.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2f90f948..467a9b46 100644 --- a/README.md +++ b/README.md @@ -113,8 +113,8 @@ Queries all the VPA objects that are labelled for this tool and summarizes their The `dashboard` and `summary` commands can exclude recommendations for a list of comma separated container names using the `--exclude-containers` argument. This option can be useful for hiding recommendations for sidecar containers for things like Linkerd and Istio. -Containers can be excluded for individual deployments by applying an annotation to any deployment. The annotation value should be a list of comma separated container names. The annotation value will be combined with any values provided through the `--exclude-containers` argument. +Containers can be excluded for individual deployments by applying a label to any deployment. The label value should be a list of comma separated container names. The label value will be combined with any values provided through the `--exclude-containers` argument. -Example annotation: +Example label: -`goldilocks.fairwinds.com/exclude-containers: linkerd-proxy,istio-proxy` +`kubectl label deployment myapp goldilocks.fairwinds.com/exclude-containers=linkerd-proxy,istio-proxy` diff --git a/pkg/summary/summary.go b/pkg/summary/summary.go index 27c8fee9..98ba1cde 100644 --- a/pkg/summary/summary.go +++ b/pkg/summary/summary.go @@ -100,8 +100,8 @@ func constructSummary(vpas *v1beta2.VerticalPodAutoscalerList, excludeContainers break } - if annotationValue, annotationFound := deployment.Annotations["goldilocks.fairwinds.com/exclude-containers"]; annotationFound { - containerExclusions = append(containerExclusions, strings.Split(annotationValue, ",")...) + if labelValue, labelFound := deployment.Labels["goldilocks.fairwinds.com/exclude-containers"]; labelFound { + containerExclusions = append(containerExclusions, strings.Split(labelValue, ",")...) } CONTAINER_REC_LOOP: