Skip to content

Commit

Permalink
Use separate offshootLabels and offshootSelector (#991)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalsaha committed Apr 23, 2018
1 parent 2f433c7 commit c67bf44
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion apis/voyager/v1beta1/annotations.go
Expand Up @@ -325,7 +325,7 @@ func (r Ingress) OffshootName() string {
return VoyagerPrefix + r.Name
}

func (r Ingress) OffshootLabels() map[string]string {
func (r Ingress) OffshootSelector() map[string]string {
lbl := map[string]string{
"origin": "voyager",
"origin-name": r.Name,
Expand All @@ -338,6 +338,16 @@ func (r Ingress) OffshootLabels() map[string]string {
return lbl
}

func (r Ingress) OffshootLabels() map[string]string {
lbl := r.OffshootSelector()
for k, v := range r.Labels {
if _, found := lbl[k]; !found {
lbl[k] = v
}
}
return lbl
}

func (r Ingress) StatsLabels() map[string]string {
lbl := r.OffshootLabels()
lbl["feature"] = "stats"
Expand Down

0 comments on commit c67bf44

Please sign in to comment.