Skip to content

Commit

Permalink
[service] Add AddLabel() for RoutedOverrideSpec and OverrideSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
stuggi committed Dec 14, 2023
1 parent aa1c8b9 commit f3bce4e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions modules/common/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,26 @@ func (s *Service) AddAnnotation(anno map[string]string) {
s.service.Annotations = util.MergeStringMaps(s.service.Annotations, anno)
}

// AddAnnotation - Adds annotation and merges it with the current set
func (s *RoutedOverrideSpec) AddAnnotation(anno map[string]string) {
s.Annotations = util.MergeMaps(s.Annotations, anno)
}

// AddLabel - Adds label and merges it with the current set
func (s *RoutedOverrideSpec) AddLabel(label map[string]string) {
s.Labels = util.MergeMaps(s.Labels, label)
}

// AddAnnotation - Adds annotation and merges it with the current set
func (s *OverrideSpec) AddAnnotation(anno map[string]string) {
s.Annotations = util.MergeMaps(s.Annotations, anno)
}

// AddLabel - Adds label and merges it with the current set
func (s *OverrideSpec) AddLabel(label map[string]string) {
s.Labels = util.MergeMaps(s.Labels, label)
}

// GetAPIEndpoint - returns the API endpoint URL for the service to register in keystone.
func (s *Service) GetAPIEndpoint(endpointURL *string, protocol *Protocol, path string) (string, error) {
var apiEndpoint *url.URL
Expand Down

0 comments on commit f3bce4e

Please sign in to comment.