Skip to content

Commit

Permalink
Add AddLabel()/AddAnnotation() for Route
Browse files Browse the repository at this point in the history
Signed-off-by: Elvira García <egarciar@redhat.com>
  • Loading branch information
elvgarrui committed Feb 5, 2024
1 parent c9467a8 commit 281df61
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions modules/common/route/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,20 @@ func (r *Route) Delete(

return nil
}

// AddAnnotation - Adds annotation and merges it with the current set
func (r *Route) addAnnotation(anno map[string]string) {
if r.EmbeddedLabelsAnnotations == nil {
r.EmbeddedLabelsAnnotations = &EmbededLabelsAnnotations{}
}
r.Annotations = util.MergeMaps(r.Annotations, anno)
}


// AddLabel - Adds annotation and merges it with the current set
func (r *Route) addLabel(label map[string]string) {
if r.EmbeddedLabelsAnnotations == nil {
r.EmbeddedLabelsAnnotations = &EmbededLabelsAnnotations{}
}
r.Labels = util.MergeMaps(r.Labels, label)
}

0 comments on commit 281df61

Please sign in to comment.