Skip to content

Commit 1c4cd6e

Browse files
Merge pull request openshift#1077 from SchSeba/merge-bot-master
Merge https://github.com/k8snetworkplumbingwg/sriov-network-operator:master into main
2 parents ca29a6e + f7e5086 commit 1c4cd6e

File tree

146 files changed

+7269
-1840
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+7269
-1840
lines changed

.github/workflows/test.yml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,17 @@ jobs:
4646
- name: test pkg on openshift
4747
run: CLUSTER_TYPE=openshift make test-pkg
4848

49-
- name: test cmd
50-
run: make test-cmd
49+
- name: test cmd on kubernetes
50+
run: CLUSTER_TYPE=kubernetes make test-cmd
5151

52-
- name: test api
53-
run: make test-api
52+
- name: test cmd on openshift
53+
run: CLUSTER_TYPE=openshift make test-cmd
54+
55+
- name: test cmd on kubernetes
56+
run: CLUSTER_TYPE=kubernetes make test-api
57+
58+
- name: test api on openshift
59+
run: CLUSTER_TYPE=openshift make test-api
5460

5561
- name: test controllers on openshift
5662
run: CLUSTER_TYPE=openshift make test-controllers
@@ -123,18 +129,30 @@ jobs:
123129
- name: Check out code into the Go module directory
124130
uses: actions/checkout@v2
125131

126-
- name: test pkg
127-
run: make test-pkg
132+
- name: test pkg on kubernetes
133+
run: CLUSTER_TYPE=kubernetes make test-pkg
134+
135+
- name: test pkg on openshift
136+
run: CLUSTER_TYPE=openshift make test-pkg
128137

129-
- name: test cmd
130-
run: make test-cmd
138+
- name: test cmd on kubernetes
139+
run: CLUSTER_TYPE=kubernetes make test-cmd
131140

132-
- name: test api
133-
run: make test-api
141+
- name: test cmd on openshift
142+
run: CLUSTER_TYPE=openshift make test-cmd
134143

135-
- name: test controllers on opensfhit
144+
- name: test cmd on kubernetes
145+
run: CLUSTER_TYPE=kubernetes make test-api
146+
147+
- name: test api on openshift
148+
run: CLUSTER_TYPE=openshift make test-api
149+
150+
- name: test controllers on openshift
136151
run: CLUSTER_TYPE=openshift make test-controllers
137152

153+
- name: test controllers on kubernetes
154+
run: CLUSTER_TYPE=kubernetes make test-controllers
155+
138156
- name: merge test coverage
139157
run: make merge-test-coverage
140158

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ test-bindata-scripts: fakechroot
228228
fakechroot ./test/scripts/kargs_test.sh
229229

230230
test-%: generate manifests envtest
231-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir=/tmp -p path)" HOME="$(shell pwd)" go test `go list ./$*/... | grep -v "/mock"` -coverprofile cover-$*-$(CLUSTER_TYPE).out -coverpkg ./... -v
231+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir=/tmp -p path)" HOME="$(shell pwd)" go test `go list ./$*/... | grep -v "/mock" | grep -v "/pkg/client"` -coverprofile cover-$*-$(CLUSTER_TYPE).out -coverpkg ./... -v
232232

233233
GOCOVMERGE = $(BIN_DIR)/gocovmerge
234234
gocovmerge: ## Download gocovmerge locally if necessary.

api/v1/helper.go

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -143,53 +143,6 @@ func IsVfSupportedModel(vendorID, deviceID string) bool {
143143
return false
144144
}
145145

146-
func IsEnabledUnsupportedVendor(vendorID string, unsupportedNicIDMap map[string]string) bool {
147-
for _, n := range unsupportedNicIDMap {
148-
if IsValidPciString(n) {
149-
ids := strings.Split(n, " ")
150-
if vendorID == ids[0] {
151-
return true
152-
}
153-
}
154-
}
155-
return false
156-
}
157-
158-
func IsValidPciString(nicIDString string) bool {
159-
ids := strings.Split(nicIDString, " ")
160-
161-
if len(ids) != 3 {
162-
log.Info("IsValidPciString(): ", nicIDString)
163-
return false
164-
}
165-
166-
if len(ids[0]) != 4 {
167-
log.Info("IsValidPciString():", "Invalid vendor PciId ", ids[0])
168-
return false
169-
}
170-
if _, err := strconv.ParseInt(ids[0], 16, 32); err != nil {
171-
log.Info("IsValidPciString():", "Invalid vendor PciId ", ids[0])
172-
}
173-
174-
if len(ids[1]) != 4 {
175-
log.Info("IsValidPciString():", "Invalid PciId of PF ", ids[1])
176-
return false
177-
}
178-
if _, err := strconv.ParseInt(ids[1], 16, 32); err != nil {
179-
log.Info("IsValidPciString():", "Invalid PciId of PF ", ids[1])
180-
}
181-
182-
if len(ids[2]) != 4 {
183-
log.Info("IsValidPciString():", "Invalid PciId of VF ", ids[2])
184-
return false
185-
}
186-
if _, err := strconv.ParseInt(ids[2], 16, 32); err != nil {
187-
log.Info("IsValidPciString():", "Invalid PciId of VF ", ids[2])
188-
}
189-
190-
return true
191-
}
192-
193146
func GetSupportedVfIds() []string {
194147
var vfIds []string
195148
for _, n := range NicIDMap {
@@ -233,15 +186,6 @@ func ContainsSwitchdevInterface(interfaces []Interface) bool {
233186
return false
234187
}
235188

236-
func FindInterface(interfaces Interfaces, name string) (iface Interface, err error) {
237-
for _, i := range interfaces {
238-
if i.Name == name {
239-
return i, nil
240-
}
241-
}
242-
return Interface{}, fmt.Errorf("unable to find interface: %v", name)
243-
}
244-
245189
// GetEswitchModeFromSpec returns ESwitchMode from the interface spec, returns legacy if not set
246190
func GetEswitchModeFromSpec(ifaceSpec *Interface) string {
247191
if ifaceSpec.EswitchMode == "" {

bundle/manifests/sriov-network-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ metadata:
100100
categories: Networking
101101
certified: "false"
102102
containerImage: quay.io/openshift/origin-sriov-network-operator:4.19
103-
createdAt: "2025-04-01T23:50:01Z"
103+
createdAt: "2025-04-06T23:49:43Z"
104104
description: An operator for configuring SR-IOV components and initializing SRIOV
105105
network devices in Openshift cluster.
106106
features.operators.openshift.io/cnf: "false"

cmd/sriov-network-config-daemon/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func (s *ServiceConfig) phasePre() error {
194194

195195
func (s *ServiceConfig) phasePost() error {
196196
s.log.V(0).Info("check result of the Pre phase")
197-
prePhaseResult, _, err := s.hostHelper.ReadSriovResult()
197+
prePhaseResult, err := s.hostHelper.ReadSriovResult()
198198
if err != nil {
199199
return fmt.Errorf("failed to read result of the pre phase: %v", err)
200200
}

cmd/sriov-network-config-daemon/service_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ var _ = Describe("Service", func() {
223223
Name: "enp216s0f0np0",
224224
}}, nil)
225225
hostHelpers.EXPECT().DiscoverBridges().Return(sriovnetworkv1.Bridges{}, nil)
226-
hostHelpers.EXPECT().ReadSriovResult().Return(getTestResultFileContent("InProgress", ""), false, nil)
226+
hostHelpers.EXPECT().ReadSriovResult().Return(getTestResultFileContent("InProgress", ""), nil)
227227
hostHelpers.EXPECT().ReadConfFile().Return(getTestSriovInterfaceConfig(0), nil)
228228
hostHelpers.EXPECT().ReadSriovSupportedNics().Return(testSriovSupportedNicIDs, nil)
229229
hostHelpers.EXPECT().WriteSriovResult(&hosttypes.SriovResult{SyncStatus: consts.SyncStatusSucceeded})
@@ -238,7 +238,7 @@ var _ = Describe("Service", func() {
238238
phaseArg = PhasePost
239239
hostHelpers.EXPECT().ReadConfFile().Return(getTestSriovInterfaceConfig(1), nil)
240240
hostHelpers.EXPECT().ReadSriovSupportedNics().Return(testSriovSupportedNicIDs, nil)
241-
hostHelpers.EXPECT().ReadSriovResult().Return(getTestResultFileContent("InProgress", ""), false, nil)
241+
hostHelpers.EXPECT().ReadSriovResult().Return(getTestResultFileContent("InProgress", ""), nil)
242242
hostHelpers.EXPECT().WriteSriovResult(&hosttypes.SriovResult{SyncStatus: consts.SyncStatusSucceeded})
243243

244244
Expect(runServiceCmd(&cobra.Command{}, []string{})).NotTo(HaveOccurred())
@@ -249,7 +249,7 @@ var _ = Describe("Service", func() {
249249
phaseArg = PhasePost
250250
hostHelpers.EXPECT().ReadConfFile().Return(getTestSriovInterfaceConfig(1), nil)
251251
hostHelpers.EXPECT().ReadSriovSupportedNics().Return(testSriovSupportedNicIDs, nil)
252-
hostHelpers.EXPECT().ReadSriovResult().Return(getTestResultFileContent("Failed", "pretest"), false, nil)
252+
hostHelpers.EXPECT().ReadSriovResult().Return(getTestResultFileContent("Failed", "pretest"), nil)
253253
hostHelpers.EXPECT().WriteSriovResult(&hosttypes.SriovResult{SyncStatus: consts.SyncStatusFailed, LastSyncError: "post: unexpected result of the pre phase: Failed, syncError: pretest"})
254254

255255
Expect(runServiceCmd(&cobra.Command{}, []string{})).To(HaveOccurred())

go.mod

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ require (
2424
github.com/onsi/ginkgo/v2 v2.22.1
2525
github.com/onsi/gomega v1.36.2
2626
github.com/openshift-kni/k8sreporter v1.0.4
27-
github.com/openshift/api v0.0.0-20250129172457-b1a9b9a2e7fe
27+
github.com/openshift/api v0.0.0-20250227152946-1ee1ef831100
2828
github.com/openshift/client-go v0.0.0-20250125113824-8e1f0b8fa9a7
29-
github.com/openshift/machine-config-operator v0.0.1-0.20250304041132-19ba3dda6e7a
29+
github.com/openshift/machine-config-operator v0.0.1-0.20250320230514-53e78f3692ee
3030
github.com/ovn-org/libovsdb v0.6.1-0.20240125124854-03f787b1a892
3131
github.com/pkg/errors v0.9.1
3232
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.74.0
@@ -62,7 +62,7 @@ require (
6262
github.com/Mellanox/sriovnet v1.0.3 // indirect
6363
github.com/StackExchange/wmi v1.2.1 // indirect
6464
github.com/ajeddeloh/go-json v0.0.0-20200220154158-5ae607161559 // indirect
65-
github.com/aws/aws-sdk-go v1.45.20 // indirect
65+
github.com/aws/aws-sdk-go v1.55.5 // indirect
6666
github.com/beorn7/perks v1.0.1 // indirect
6767
github.com/blang/semver/v4 v4.0.0 // indirect
6868
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
@@ -137,14 +137,14 @@ require (
137137
github.com/samber/lo v1.47.0 // indirect
138138
github.com/shopspring/decimal v1.2.0 // indirect
139139
github.com/spf13/afero v1.11.0 // indirect
140-
github.com/spf13/cast v1.5.1 // indirect
140+
github.com/spf13/cast v1.7.0 // indirect
141141
github.com/spf13/pflag v1.0.6 // indirect
142142
github.com/stretchr/objx v0.5.2 // indirect
143143
github.com/vincent-petithory/dataurl v1.0.0 // indirect
144144
github.com/x448/float16 v0.8.4 // indirect
145145
github.com/xlab/treeprint v1.2.0 // indirect
146-
go.opentelemetry.io/otel v1.29.0 // indirect
147-
go.opentelemetry.io/otel/trace v1.29.0 // indirect
146+
go.opentelemetry.io/otel v1.31.0 // indirect
147+
go.opentelemetry.io/otel/trace v1.31.0 // indirect
148148
go.uber.org/multierr v1.11.0 // indirect
149149
go4.org v0.0.0-20200104003542-c7e774b10ea0 // indirect
150150
golang.org/x/crypto v0.32.0 // indirect
@@ -157,8 +157,8 @@ require (
157157
golang.org/x/time v0.9.0 // indirect
158158
golang.org/x/tools v0.29.0 // indirect
159159
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
160-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
161-
google.golang.org/grpc v1.66.2 // indirect
160+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d // indirect
161+
google.golang.org/grpc v1.69.4 // indirect
162162
google.golang.org/protobuf v1.36.4 // indirect
163163
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
164164
gopkg.in/inf.v0 v0.9.1 // indirect

0 commit comments

Comments
 (0)