Dynamic Configuration Refactoring
This commit is contained in:
parent
d3ae88f108
commit
a09dfa3ce1
452 changed files with 21023 additions and 9419 deletions
44
old/provider/kubernetes/annotations_test.go
Normal file
44
old/provider/kubernetes/annotations_test.go
Normal file
|
@ -0,0 +1,44 @@
|
|||
package kubernetes
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/containous/traefik/old/provider/label"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestGetAnnotationName(t *testing.T) {
|
||||
testCases := []struct {
|
||||
desc string
|
||||
annotations map[string]string
|
||||
name string
|
||||
expected string
|
||||
}{
|
||||
{
|
||||
desc: "with standard annotation",
|
||||
name: annotationKubernetesPreserveHost,
|
||||
annotations: map[string]string{
|
||||
annotationKubernetesPreserveHost: "true",
|
||||
},
|
||||
expected: annotationKubernetesPreserveHost,
|
||||
},
|
||||
{
|
||||
desc: "with prefixed annotation",
|
||||
name: annotationKubernetesPreserveHost,
|
||||
annotations: map[string]string{
|
||||
label.Prefix + annotationKubernetesPreserveHost: "true",
|
||||
},
|
||||
expected: label.Prefix + annotationKubernetesPreserveHost,
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range testCases {
|
||||
test := test
|
||||
t.Run(test.desc, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
actual := getAnnotationName(test.annotations, test.name)
|
||||
assert.Equal(t, test.expected, actual)
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue