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:
Zenghui Shi
2019-04-25 15:31:45 +08:00
committed by dougbtv
parent a4dbe7b102
commit 09fde13d79

View File

@@ -272,6 +272,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)
@@ -306,6 +307,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 {