Skip to content

Commit 6b0c4c0

Browse files
Add testing for multi ib-kubernetes environments
1 parent 7804b09 commit 6b0c4c0

File tree

8 files changed

+1233
-5
lines changed

8 files changed

+1233
-5
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ envtest: $(ENVTEST) ## Download envtest if necessary
9292
$(ENVTEST): | $(BIN_DIR);$(info building envtest...)
9393
$(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@$(ENVTEST_VERSION))
9494

95+
LOCALBIN ?= $(shell pwd)/bin
96+
.PHONY: test
97+
test: envtest ## Run tests.
98+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test -v ./... -coverprofile cover.out
99+
95100
GOCOVMERGE := $(BIN_DIR)/gocovmerge
96101
GOCOVMERGE_VERSION := latest
97102
.PHONY: gocovmerge

go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ require (
2323
github.com/containernetworking/cni v1.2.0-rc1 // indirect
2424
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
2525
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
26+
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
2627
github.com/fsnotify/fsnotify v1.7.0 // indirect
2728
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
2829
github.com/go-logr/logr v1.4.2 // indirect
30+
github.com/go-logr/zapr v1.3.0 // indirect
2931
github.com/go-openapi/jsonpointer v0.21.0 // indirect
3032
github.com/go-openapi/jsonreference v0.21.0 // indirect
3133
github.com/go-openapi/swag v0.23.0 // indirect
@@ -52,6 +54,8 @@ require (
5254
github.com/spf13/pflag v1.0.5 // indirect
5355
github.com/stretchr/objx v0.5.2 // indirect
5456
github.com/x448/float16 v0.8.4 // indirect
57+
go.uber.org/multierr v1.11.0 // indirect
58+
go.uber.org/zap v1.26.0 // indirect
5559
golang.org/x/net v0.29.0 // indirect
5660
golang.org/x/oauth2 v0.23.0 // indirect
5761
golang.org/x/sys v0.25.0 // indirect
@@ -65,6 +69,7 @@ require (
6569
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
6670
gopkg.in/yaml.v2 v2.4.0 // indirect
6771
gopkg.in/yaml.v3 v3.0.1 // indirect
72+
k8s.io/apiextensions-apiserver v0.31.0 // indirect
6873
k8s.io/klog/v2 v2.130.1 // indirect
6974
k8s.io/kube-openapi v0.0.0-20240903163716-9e1beecbcb38 // indirect
7075
k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3 // indirect

go.sum

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0=
22
github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
3+
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
4+
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
35
github.com/caarlos0/env/v11 v11.2.2 h1:95fApNrUyueipoZN/EhA8mMxiNxrBwDa+oAZrMWl3Kg=
46
github.com/caarlos0/env/v11 v11.2.2/go.mod h1:JBfcdeQiBoI3Zh1QRAWfe+tpiNTmDtcCj/hHHHMx0vc=
7+
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
8+
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
59
github.com/containernetworking/cni v1.2.0-rc1 h1:AKI3+pXtgY4PDLN9+50o9IaywWVuey0Jkw3Lvzp0HCY=
610
github.com/containernetworking/cni v1.2.0-rc1/go.mod h1:Lt0TQcZQVDju64fYxUhDziTgXCDe3Olzi9I4zZJLWHg=
711
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
@@ -11,6 +15,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
1115
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1216
github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU=
1317
github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
18+
github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg=
19+
github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ=
1420
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
1521
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
1622
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
@@ -33,6 +39,8 @@ github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZ
3339
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
3440
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
3541
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
42+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
43+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
3644
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
3745
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
3846
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
@@ -105,6 +113,14 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
105113
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
106114
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
107115
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
116+
github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE=
117+
github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho=
118+
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
119+
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
120+
github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc=
121+
github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8=
122+
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
123+
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
108124
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
109125
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
110126
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
@@ -125,13 +141,17 @@ github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
125141
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
126142
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
127143
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
144+
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
145+
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
128146
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
129147
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
130148
go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
131149
go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
132150
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
133151
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
134152
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
153+
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8=
154+
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
135155
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
136156
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
137157
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -181,6 +201,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
181201
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
182202
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
183203
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
204+
gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
205+
gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
184206
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
185207
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
186208
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -209,6 +231,8 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
209231
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
210232
k8s.io/api v0.31.0 h1:b9LiSjR2ym/SzTOlfMHm1tr7/21aD7fSkqgD/CVJBCo=
211233
k8s.io/api v0.31.0/go.mod h1:0YiFF+JfFxMM6+1hQei8FY8M7s1Mth+z/q7eF1aJkTE=
234+
k8s.io/apiextensions-apiserver v0.31.0 h1:fZgCVhGwsclj3qCw1buVXCV6khjRzKC5eCFt24kyLSk=
235+
k8s.io/apiextensions-apiserver v0.31.0/go.mod h1:b9aMDEYaEe5sdK+1T0KU78ApR/5ZVp4i56VacZYEHxk=
212236
k8s.io/apimachinery v0.31.0 h1:m9jOiSr3FoSSL5WO9bjm1n6B9KROYYgNZOb4tyZ1lBc=
213237
k8s.io/apimachinery v0.31.0/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
214238
k8s.io/client-go v0.31.0 h1:QqEJzNjbN2Yv1H79SsS+SWnXkBgVu4Pj3CJQgbx0gI8=
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: network-attachment-definitions.k8s.cni.cncf.io
5+
spec:
6+
group: k8s.cni.cncf.io
7+
scope: Namespaced
8+
names:
9+
plural: network-attachment-definitions
10+
singular: network-attachment-definition
11+
kind: NetworkAttachmentDefinition
12+
shortNames:
13+
- net-attach-def
14+
versions:
15+
- name: v1
16+
served: true
17+
storage: true
18+
schema:
19+
openAPIV3Schema:
20+
description: 'NetworkAttachmentDefinition is a CRD schema specified by the Network Plumbing
21+
Working Group to express the intent for attaching pods to one or more logical or physical
22+
networks. More information available at: https://github.com/k8snetworkplumbingwg/multi-net-spec'
23+
type: object
24+
properties:
25+
apiVersion:
26+
description: 'APIVersion defines the versioned schema of this represen
27+
tation of an object. Servers should convert recognized schemas to the
28+
latest internal value, and may reject unrecognized values. More info:
29+
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
30+
type: string
31+
kind:
32+
description: 'Kind is a string value representing the REST resource this
33+
object represents. Servers may infer this from the endpoint the client
34+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
35+
type: string
36+
metadata:
37+
type: object
38+
spec:
39+
description: 'NetworkAttachmentDefinition spec defines the desired state of a network attachment'
40+
type: object
41+
properties:
42+
config:
43+
description: 'NetworkAttachmentDefinition config is a JSON-formatted CNI configuration'
44+
type: string

pkg/config/config_test.go

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var _ = Describe("Configuration", func() {
2222
Expect(os.Setenv("DAEMON_SM_PLUGIN_PATH", "/custom/plugins/location")).ToNot(HaveOccurred())
2323
Expect(os.Setenv("DEFAULT_LIMITED_PARTITION", "0x2")).ToNot(HaveOccurred())
2424
Expect(os.Setenv("ENABLE_IP_OVER_IB", "true")).ToNot(HaveOccurred())
25+
Expect(os.Setenv("MANAGED_RESOURCE_NAMES", "intel.com/ib_sriov,nvidia.com/ib_sriov")).ToNot(HaveOccurred())
2526

2627
err := dc.ReadConfig()
2728
Expect(err).ToNot(HaveOccurred())
@@ -32,10 +33,12 @@ var _ = Describe("Configuration", func() {
3233
Expect(dc.PluginPath).To(Equal("/custom/plugins/location"))
3334
Expect(dc.DefaultLimitedPartition).To(Equal("0x2"))
3435
Expect(dc.EnableIPOverIB).To(BeTrue())
36+
Expect(dc.ManagedResources).To(Equal(map[string]bool{"intel.com/ib_sriov": true, "nvidia.com/ib_sriov": true}))
3537
})
3638
It("Read configuration with default values", func() {
3739
dc := &DaemonConfig{}
3840
Expect(os.Setenv("DAEMON_SM_PLUGIN", "ufm")).ToNot(HaveOccurred())
41+
Expect(os.Setenv("MANAGED_RESOURCE_NAMES", "intel.com/ib_sriov,nvidia.com/ib_sriov")).ToNot(HaveOccurred())
3942

4043
err := dc.ReadConfig()
4144
Expect(err).ToNot(HaveOccurred())
@@ -46,18 +49,21 @@ var _ = Describe("Configuration", func() {
4649
Expect(dc.PluginPath).To(Equal("/plugins"))
4750
Expect(dc.DefaultLimitedPartition).To(Equal("")) // Default should be empty
4851
Expect(dc.EnableIPOverIB).To(BeFalse()) // Default should be false
52+
Expect(dc.ManagedResources).To(Equal(map[string]bool{"intel.com/ib_sriov": true, "nvidia.com/ib_sriov": true}))
4953
})
5054
It("Read configuration with new environment variables", func() {
5155
dc := &DaemonConfig{}
5256

5357
Expect(os.Setenv("DAEMON_SM_PLUGIN", "ufm")).ToNot(HaveOccurred())
5458
Expect(os.Setenv("DEFAULT_LIMITED_PARTITION", "0x1")).ToNot(HaveOccurred())
5559
Expect(os.Setenv("ENABLE_IP_OVER_IB", "true")).ToNot(HaveOccurred())
60+
Expect(os.Setenv("MANAGED_RESOURCE_NAMES", "intel.com/ib_sriov,nvidia.com/ib_sriov")).ToNot(HaveOccurred())
5661

5762
err := dc.ReadConfig()
5863
Expect(err).ToNot(HaveOccurred())
5964
Expect(dc.DefaultLimitedPartition).To(Equal("0x1"))
6065
Expect(dc.EnableIPOverIB).To(BeTrue())
66+
Expect(dc.ManagedResources).To(Equal(map[string]bool{"intel.com/ib_sriov": true, "nvidia.com/ib_sriov": true}))
6167
})
6268
})
6369
Context("ValidateConfig", func() {
@@ -67,7 +73,8 @@ var _ = Describe("Configuration", func() {
6773
GUIDPool: GUIDPoolConfig{
6874
RangeStart: "02:00:00:00:00:00:00:10",
6975
RangeEnd: "02:00:00:00:00:00:00:FF"},
70-
Plugin: "noop"}
76+
ManagedResources: map[string]bool{"intel.com/ib_sriov": true, "nvidia.com/ib_sriov": true},
77+
Plugin: "noop"}
7178

7279
err := dc.ValidateConfig()
7380
Expect(err).ToNot(HaveOccurred())
@@ -83,17 +90,23 @@ var _ = Describe("Configuration", func() {
8390
Expect(err).To(HaveOccurred())
8491
})
8592
It("Validate configuration with guid pool start not set", func() {
86-
dc := &DaemonConfig{PeriodicUpdate: 10, Plugin: "ufm"}
93+
dc := &DaemonConfig{PeriodicUpdate: 10, Plugin: "ufm", ManagedResources: map[string]bool{"intel.com/ib_sriov": true, "nvidia.com/ib_sriov": true}}
8794
err := dc.ValidateConfig()
8895
Expect(err).ToNot(HaveOccurred())
8996
})
9097
It("Validate configuration with guid pool end not set", func() {
9198
dc := &DaemonConfig{
92-
PeriodicUpdate: 10,
93-
GUIDPool: GUIDPoolConfig{RangeStart: "02:00:00:00:00:00:00:00"},
94-
Plugin: "ufm"}
99+
PeriodicUpdate: 10,
100+
GUIDPool: GUIDPoolConfig{RangeStart: "02:00:00:00:00:00:00:00"},
101+
ManagedResources: map[string]bool{"intel.com/ib_sriov": true, "nvidia.com/ib_sriov": true},
102+
Plugin: "ufm"}
95103
err := dc.ValidateConfig()
96104
Expect(err).ToNot(HaveOccurred())
97105
})
106+
It("Validate configuration with no managed resources", func() {
107+
dc := &DaemonConfig{PeriodicUpdate: 10, Plugin: "ufm"}
108+
err := dc.ValidateConfig()
109+
Expect(err).To(HaveOccurred())
110+
})
98111
})
99112
})

0 commit comments

Comments
 (0)