mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-07-05 20:06:16 +00:00
assign device id to pciBusID in delegated config
This allows host-device plugin to recognize Device PCI address passed from Multus. It is related to the change in host-device which enables use of device pci address as a config option: https://github.com/containernetworking/plugins/pull/300
This commit is contained in:
parent
1a32c636ff
commit
91d9964d07
@ -273,6 +273,7 @@ func delegateAddDeviceID(inBytes []byte, deviceID string) ([]byte, error) {
|
||||
}
|
||||
// Inject deviceID
|
||||
rawConfig["deviceID"] = deviceID
|
||||
rawConfig["pciBusID"] = deviceID
|
||||
configBytes, err := json.Marshal(rawConfig)
|
||||
if err != nil {
|
||||
return nil, logging.Errorf("delegateAddDeviceID: failed to re-marshal Spec.Config: %v", err)
|
||||
@ -307,6 +308,7 @@ func addDeviceIDInConfList(inBytes []byte, deviceID string) ([]byte, error) {
|
||||
}
|
||||
// Inject deviceID
|
||||
firstPlugin["deviceID"] = deviceID
|
||||
firstPlugin["pciBusID"] = deviceID
|
||||
|
||||
configBytes, err := json.Marshal(rawConfig)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user