-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathlabel_test.go
45 lines (37 loc) · 936 Bytes
/
label_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package labels_test
import (
"testing"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/ydb-platform/ydb-kubernetes-operator/internal/labels"
)
func TestLabels(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Label suite")
}
var _ = Describe("Testing labels", func() {
It("merges two sets of labels", func() {
fstLabels := labels.Labels{
"a": "a",
"b": "b",
}
sndLabels := labels.Labels{
"c": "c",
"d": "d",
}
Expect(fstLabels.Merge(sndLabels)).To(BeEquivalentTo(map[string]string{
"a": "a",
"b": "b",
"c": "c",
"d": "d",
}))
})
It("sets correct defaults", func() {
Expect(labels.Common("ydb", map[string]string{})).To(BeEquivalentTo(map[string]string{
"app.kubernetes.io/managed-by": "ydb-operator",
"app.kubernetes.io/part-of": "yandex-database",
"app.kubernetes.io/name": "ydb",
"app.kubernetes.io/instance": "ydb",
}))
})
})