Changed the if-else logic of how node drain is handled
@@ -248,8 +248,10 @@ func isSafeContainerRegistryConfChanges(oldIgnConfig, newIgnConfig ign3types.Con
// Check for modified registry
for regLoc, newReg := range newRegHashMap {
oldReg, ok := oldRegHashMap[regLoc]
- if ok && !reflect.DeepEqual(oldReg, newReg) {
- // Registry is available in both old and new config and some changes has been found.
+ if ok {
+ // Registry is available in both old and new config.
+ if !reflect.DeepEqual(oldReg, newReg) {
+ // Registry has been changed in the new config.
// Check that changes made are safe or not.
if oldReg.Prefix != newReg.Prefix {
glog.Infof("%s: prefix value for registry %s has changed from %s to %s",
@@ -293,6 +295,7 @@ func isSafeContainerRegistryConfChanges(oldIgnConfig, newIgnConfig ign3types.Con
constants.ContainerRegistryConfPath, regLoc, oldReg.MirrorByDigestOnly, newReg.MirrorByDigestOnly)
return false, nil
}
+ }
} else if !newReg.MirrorByDigestOnly {
// New mirrors added into registry but mirror-by-digest-only has been set to false
glog.Infof("%s: registry %s has been added with mirror-by-digest-only set to %t",
