Skip to content

Commit

Permalink
Merge pull request openshift#2120 from cgwalters/oncefrom-unlink-encap
Browse files Browse the repository at this point in the history
Bug 1882667: daemon: Unlink encapsulated config in once-from mode
  • Loading branch information
openshift-merge-robot authored Sep 25, 2020
2 parents a3c9532 + 9096b4a commit ef4215d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,17 @@ func (dn *Daemon) detectEarlySSHAccessesFromBoot() error {
func (dn *Daemon) RunOnceFrom(onceFrom string, skipReboot bool) error {
dn.skipReboot = skipReboot

// Unconditionally remove this file in the once-from (classic RHEL)
// case. We use this file to suppress things like kubelet and SDN
// starting on CoreOS during the firstboot/pivot boot, but there's
// no such thing on classic RHEL.
_, err := os.Stat(constants.MachineConfigEncapsulatedPath)
if err == nil {
if err := os.Remove(constants.MachineConfigEncapsulatedPath); err != nil {
return errors.Wrapf(err, "failed to remove %s", constants.MachineConfigEncapsulatedPath)
}
}

configi, contentFrom, err := dn.senseAndLoadOnceFrom(onceFrom)
if err != nil {
glog.Warningf("Unable to decipher onceFrom config type: %s", err)
Expand Down

0 comments on commit ef4215d

Please sign in to comment.