File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -338,6 +338,11 @@ func (dp *DevicePlugin) getDpdkMounts(dpdkDeviceName string) []pluginapi.Mount {
338338 }
339339}
340340
341+ // Trim services reported by the kernel into k8s resource names.
342+ func trimServiceName (serviceName string ) string {
343+ return strings .Replace (strings .TrimSpace (serviceName ), ";" , "-" , 2 )
344+ }
345+
341346func readDeviceConfiguration (pfDev string ) string {
342347 qatState , err := os .ReadFile (filepath .Join (pfDev , "qat/state" ))
343348 if err != nil && ! errors .Is (err , os .ErrNotExist ) {
@@ -353,7 +358,7 @@ func readDeviceConfiguration(pfDev string) string {
353358 }
354359
355360 if err2 == nil && len (qatCfgServices ) != 0 {
356- return strings . Join ( strings . SplitN ( strings . TrimSpace ( string (qatCfgServices )), ";" , 3 ), "-" )
361+ return trimServiceName ( string (qatCfgServices ))
357362 }
358363 }
359364
@@ -370,7 +375,7 @@ func readDeviceConfiguration(pfDev string) string {
370375 return defaultCapabilities
371376 }
372377
373- return devCfg .Section ("GENERAL" ).Key ("ServicesEnabled" ).String ()
378+ return trimServiceName ( devCfg .Section ("GENERAL" ).Key ("ServicesEnabled" ).String () )
374379}
375380
376381func getDeviceHealthiness (device string , lookup map [string ]string ) string {
You can’t perform that action at this time.
0 commit comments