Skip to content

Commit

Permalink
Use a character not valid for kubernetes names to join values for uni…
Browse files Browse the repository at this point in the history
…que UID
  • Loading branch information
jsoriano committed Feb 28, 2019
1 parent a3376e1 commit 304bec5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion metricbeat/module/kubernetes/util/metrics_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,5 @@ func (m *valueMap) Stop() {

// ContainerUID creates an unique ID for from namespace, pod name and container name
func ContainerUID(namespace, pod, container string) string {
return namespace + "-" + pod + "-" + container
return namespace + "/" + pod + "/" + container
}
2 changes: 1 addition & 1 deletion metricbeat/module/kubernetes/util/metrics_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ func TestGetWithDefault(t *testing.T) {
}

func TestContainerUID(t *testing.T) {
assert.Equal(t, "a-b-c", ContainerUID("a", "b", "c"))
assert.Equal(t, "a/b/c", ContainerUID("a", "b", "c"))
}

0 comments on commit 304bec5

Please sign in to comment.