K8s remove string ops (#2119)

* plugin/kubernetes: remove bunch a string ops

This removes a bunch of appends to where not needed, makes dnsutil.Join
take variadic args which removes the need to wrap in a new string slice.

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix calls to dnsutil.Join

Signed-off-by: Miek Gieben <miek@miek.nl>

* Revert these

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben 2018-09-22 15:12:02 +01:00 committed by GitHub
parent b3d69f1c7f
commit 9546b606cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 31 additions and 44 deletions

View file

@ -9,11 +9,12 @@ func TestJoin(t *testing.T) {
}{
{[]string{"bla", "bliep", "example", "org"}, "bla.bliep.example.org."},
{[]string{"example", "."}, "example."},
{[]string{"example", "org."}, "example.org."}, // technically we should not be called like this.
{[]string{"."}, "."},
}
for i, tc := range tests {
if x := Join(tc.in); x != tc.out {
if x := Join(tc.in...); x != tc.out {
t.Errorf("Test %d, expected %s, got %s", i, tc.out, x)
}
}