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 Doug Smith
parent 1a32c636ff
commit 91d9964d07

View File

@ -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 {