...
1
16
17 package image
18
19 import (
20 "testing"
21
22 "github.com/stretchr/testify/assert"
23 "k8s.io/apimachinery/pkg/util/sets"
24 )
25
26 func TestCSIImageConfigs(t *testing.T) {
27 configs := map[ImageID]Config{}
28 appendCSIImageConfigs(configs)
29
30
31
32
33
34
35
36
37 expectedImages := []string{
38 "csi-attacher",
39 "csi-external-health-monitor-controller",
40 "csi-node-driver-registrar",
41 "csi-provisioner",
42 "csi-resizer",
43 "csi-snapshotter",
44 "hostpathplugin",
45 "livenessprobe",
46
47
48 "gcp-compute-persistent-disk-csi-driver",
49
50
51 "busybox",
52
53
54 "volume-data-source-validator",
55 "hello-populator",
56 }
57 actualImages := sets.NewString()
58 for _, config := range configs {
59 assert.NotEmpty(t, config.registry, "registry")
60 assert.NotEmpty(t, config.name, "name")
61 assert.NotEmpty(t, config.version, "version")
62 actualImages.Insert(config.name)
63 }
64 assert.ElementsMatch(t, expectedImages, actualImages.UnsortedList(), "found these images: %+v", configs)
65 }
66
View as plain text