Skip to content

Commit

Permalink
Replace annotation with label for consistency with project
Browse files Browse the repository at this point in the history
  • Loading branch information
davekonopka authored and Andrew Suderman committed Aug 1, 2019
1 parent b5f87c5 commit 2672b67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
4 changes: 2 additions & 2 deletions pkg/summary/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2672b67

Please sign in to comment.