Skip to content

Commit

Permalink
Merge pull request #1891 from runcom/fix-force
Browse files Browse the repository at this point in the history
pkg/daemon: make force use the force
  • Loading branch information
openshift-merge-robot authored Jul 8, 2020
2 parents dfb4b49 + 0ec7a80 commit ab4d38c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ func (dn *Daemon) checkStateOnFirstRun() error {
if currentOnDisk != nil && state.currentConfig.GetName() != currentOnDisk.GetName() {
// The on disk state (if available) is always considered truth.
// We want to handle the case where etcd state was restored from a backup.
dn.logSystem("Disk currentConfig %s overrides node annotation %s", currentOnDisk.GetName(), state.currentConfig.GetName())
dn.logSystem("Disk currentConfig %s overrides node's currentConfig annotation %s", currentOnDisk.GetName(), state.currentConfig.GetName())
state.currentConfig = currentOnDisk
}

Expand All @@ -1049,6 +1049,7 @@ func (dn *Daemon) checkStateOnFirstRun() error {
glog.Infof("Validating against current config %s", state.currentConfig.GetName())
expectedConfig = state.currentConfig
}

if _, err := os.Stat(constants.MachineConfigDaemonForceFile); err != nil {
if err := dn.validateOnDiskState(expectedConfig); err != nil {
return fmt.Errorf("unexpected on-disk state validating against %s: %v", expectedConfig.GetName(), err)
Expand All @@ -1059,6 +1060,7 @@ func (dn *Daemon) checkStateOnFirstRun() error {
if err := os.Remove(constants.MachineConfigDaemonForceFile); err != nil {
return errors.Wrap(err, "failed to remove force validation file")
}
return dn.triggerUpdateWithMachineConfig(state.currentConfig, state.desiredConfig)
}

// We've validated our state. In the case where we had a pendingConfig,
Expand Down

0 comments on commit ab4d38c

Please sign in to comment.