|
@@ -184,6 +184,16 @@ func (c *controller) handleKeyChange(keys []*types.EncryptionKey) error {
|
|
|
err := driver.DiscoverNew(discoverapi.EncryptionKeysUpdate, drvEnc)
|
|
|
if err != nil {
|
|
|
logrus.Warnf("Failed to update datapath keys in driver %s: %v", name, err)
|
|
|
+ // Attempt to reconfigure keys in case of a update failure
|
|
|
+ // which can arise due to a mismatch of keys
|
|
|
+ // if worker nodes get temporarily disconnected
|
|
|
+ logrus.Warnf("Reconfiguring datapath keys for %s", name)
|
|
|
+ drvCfgEnc := discoverapi.DriverEncryptionConfig{}
|
|
|
+ drvCfgEnc.Keys, drvCfgEnc.Tags = c.getKeys(subsysIPSec)
|
|
|
+ err = driver.DiscoverNew(discoverapi.EncryptionKeysConfig, drvCfgEnc)
|
|
|
+ if err != nil {
|
|
|
+ logrus.Warnf("Failed to reset datapath keys in driver %s: %v", name, err)
|
|
|
+ }
|
|
|
}
|
|
|
return false
|
|
|
})
|