Fix spelling mistake (#8879)

* Fix spelling mistake

Signed-off-by: kjinan <2008kongxiangsheng@163.com>

* Update discovery/kubernetes/endpoints.go

Co-authored-by: Julien Pivotto <roidelapluie@gmail.com>
Signed-off-by: kjinan <2008kongxiangsheng@163.com>

Co-authored-by: Julien Pivotto <roidelapluie@gmail.com>
This commit is contained in:
kongxs 2021-06-01 06:49:29 +08:00 committed by GitHub
parent 8246f27580
commit 632678a461
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -221,7 +221,7 @@ func (e *Endpoints) buildEndpoints(eps *apiv1.Endpoints) *targetgroup.Group {
endpointsNameLabel: lv(eps.Name), endpointsNameLabel: lv(eps.Name),
} }
e.addServiceLabels(eps.Namespace, eps.Name, tg) e.addServiceLabels(eps.Namespace, eps.Name, tg)
//add endponits labels metadata // Add endpoints labels metadata.
for k, v := range eps.Labels { for k, v := range eps.Labels {
ln := strutil.SanitizeLabelName(k) ln := strutil.SanitizeLabelName(k)
tg.Labels[model.LabelName(endpointsLabelPrefix+ln)] = lv(v) tg.Labels[model.LabelName(endpointsLabelPrefix+ln)] = lv(v)

View File

@ -110,8 +110,8 @@ func (d k8sDiscoveryTest) Run(t *testing.T) {
} }
} }
// readResultWithTimeout reads all targegroups from channel with timeout. // readResultWithTimeout reads all targetgroups from channel with timeout.
// It merges targegroups by source and sends the result to result channel. // It merges targetgroups by source and sends the result to result channel.
func readResultWithTimeout(t *testing.T, ch <-chan []*targetgroup.Group, max int, timeout time.Duration, resChan chan<- map[string]*targetgroup.Group) { func readResultWithTimeout(t *testing.T, ch <-chan []*targetgroup.Group, max int, timeout time.Duration, resChan chan<- map[string]*targetgroup.Group) {
res := make(map[string]*targetgroup.Group) res := make(map[string]*targetgroup.Group)
Loop: Loop:

View File

@ -106,7 +106,7 @@ type ChunkQuerier interface {
// LabelQuerier provides querying access over labels. // LabelQuerier provides querying access over labels.
type LabelQuerier interface { type LabelQuerier interface {
// LabelValues returns all potential values for a label name. // LabelValues returns all potential values for a label name.
// It is not safe to use the strings beyond the lifefime of the querier. // It is not safe to use the strings beyond the lifetime of the querier.
// If matchers are specified the returned result set is reduced // If matchers are specified the returned result set is reduced
// to label values of metrics matching the matchers. // to label values of metrics matching the matchers.
LabelValues(name string, matchers ...*labels.Matcher) ([]string, Warnings, error) LabelValues(name string, matchers ...*labels.Matcher) ([]string, Warnings, error)