Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wildum committed Sep 13, 2023
1 parent add918d commit bd76033
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Main (unreleased)
- `discovery.serverset` discovers Serversets stored in Zookeeper. (@thampiotr)
- `discovery.scaleway` discovers scrape targets from Scaleway virtual
instances and bare-metal machines. (@rfratto)
- `discovery.dockerswarm` discovers scrape targets from Swarm. (@wildum)
- `discovery.dockerswarm` discovers scrape targets from Docker Swarm. (@wildum)

- Flow: allow the HTTP server to be configured with TLS in the config file
using the new `http` config block. (@rfratto)
Expand Down
6 changes: 3 additions & 3 deletions component/discovery/dockerswarm/dockerswarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ func convertFilters(filters []Filter) []prom_discovery.Filter {
}

func (f *Filter) convert() prom_discovery.Filter {
valuesCopy := make([]string, len(f.Values))
copy(valuesCopy, f.Values)
values := make([]string, len(f.Values))
copy(values, f.Values)

return prom_discovery.Filter{
Name: f.Name,
Values: valuesCopy,
Values: values,
}
}

Expand Down
8 changes: 4 additions & 4 deletions component/discovery/dockerswarm/dockerswarm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ func TestRiverUnmarshal(t *testing.T) {
role = "nodes"
port = 81
filter {
name = "n1"
values = ["v11", "v12"]
name = "n1"
values = ["v11", "v12"]
}
filter {
name = "n2"
values = ["v21"]
name = "n2"
values = ["v21"]
}
refresh_interval = "12s"
basic_auth {
Expand Down
6 changes: 3 additions & 3 deletions converter/internal/prometheusconvert/dockerswarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ func convertFilters(mobyFilters []prom_moby.Filter) []dockerswarm.Filter {
}

func convertFilter(mobyFilter *prom_moby.Filter) dockerswarm.Filter {
valuesCopy := make([]string, len(mobyFilter.Values))
copy(valuesCopy, mobyFilter.Values)
values := make([]string, len(mobyFilter.Values))
copy(values, mobyFilter.Values)

return dockerswarm.Filter{
Name: mobyFilter.Name,
Values: valuesCopy,
Values: values,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: discovery.dockerswarm

# discovery.dockerswarm

`discovery.dockerswarm` allows you to retrieve scrape targets from [Swarm](https://docs.docker.com/engine/swarm/key-concepts/).
`discovery.dockerswarm` allows you to retrieve scrape targets from [Docker Swarm](https://docs.docker.com/engine/swarm/key-concepts/).

## Usage

Expand Down Expand Up @@ -196,7 +196,7 @@ values.

## Example

This example discovers targets from Swarm services:
This example discovers targets from Docker Swarm tasks:

```river
discovery.dockerswarm "example" {
Expand Down

0 comments on commit bd76033

Please sign in to comment.