@@ -1005,7 +1005,7 @@ func (dn *Daemon) update(oldConfig, newConfig *mcfgv1.MachineConfig, skipCertifi
1005
1005
logSystem ("Starting update from %s to %s: %+v" , oldConfigName , newConfigName , diff )
1006
1006
1007
1007
diffFileSet := ctrlcommon .CalculateConfigFileDiffs (& oldIgnConfig , & newIgnConfig )
1008
- diffUnitSet , addedOrChangedUnits := ctrlcommon .CalculateConfigUnitDiffs (& oldIgnConfig , & newIgnConfig )
1008
+ diffUnitSet := ctrlcommon .CalculateConfigUnitDiffs (& oldIgnConfig , & newIgnConfig )
1009
1009
1010
1010
var nodeDisruptionActions []opv1.NodeDisruptionPolicyStatusAction
1011
1011
var actions []string
@@ -1117,13 +1117,13 @@ func (dn *Daemon) update(oldConfig, newConfig *mcfgv1.MachineConfig, skipCertifi
1117
1117
}
1118
1118
1119
1119
// update files on disk that need updating
1120
- if err := dn .updateFiles (oldIgnConfig , newIgnConfig , addedOrChangedUnits , skipCertificateWrite ); err != nil {
1120
+ if err := dn .updateFiles (oldIgnConfig , newIgnConfig , skipCertificateWrite ); err != nil {
1121
1121
return err
1122
1122
}
1123
1123
1124
1124
defer func () {
1125
1125
if retErr != nil {
1126
- if err := dn .updateFiles (newIgnConfig , oldIgnConfig , addedOrChangedUnits , skipCertificateWrite ); err != nil {
1126
+ if err := dn .updateFiles (newIgnConfig , oldIgnConfig , skipCertificateWrite ); err != nil {
1127
1127
errs := kubeErrs .NewAggregate ([]error {err , retErr })
1128
1128
retErr = fmt .Errorf ("error rolling back files writes: %w" , errs )
1129
1129
return
@@ -1258,17 +1258,15 @@ func (dn *Daemon) updateHypershift(oldConfig, newConfig *mcfgv1.MachineConfig, d
1258
1258
return fmt .Errorf ("parsing new Ignition config failed: %w" , err )
1259
1259
}
1260
1260
1261
- _ , addedOrChangedUnits := ctrlcommon .CalculateConfigUnitDiffs (& oldIgnConfig , & newIgnConfig )
1262
-
1263
1261
// update files on disk that need updating
1264
1262
// We should't skip the certificate write in HyperShift since it does not run the extra daemon process
1265
- if err := dn .updateFiles (oldIgnConfig , newIgnConfig , addedOrChangedUnits , false ); err != nil {
1263
+ if err := dn .updateFiles (oldIgnConfig , newIgnConfig , false ); err != nil {
1266
1264
return err
1267
1265
}
1268
1266
1269
1267
defer func () {
1270
1268
if retErr != nil {
1271
- if err := dn .updateFiles (newIgnConfig , oldIgnConfig , addedOrChangedUnits , false ); err != nil {
1269
+ if err := dn .updateFiles (newIgnConfig , oldIgnConfig , false ); err != nil {
1272
1270
errs := kubeErrs .NewAggregate ([]error {err , retErr })
1273
1271
retErr = fmt .Errorf ("error rolling back files writes: %w" , errs )
1274
1272
return
@@ -1773,12 +1771,12 @@ func (dn *CoreOSDaemon) switchKernel(oldConfig, newConfig *mcfgv1.MachineConfig)
1773
1771
// whatever has been written is picked up by the appropriate daemons, if
1774
1772
// required. in particular, a daemon-reload and restart for any unit files
1775
1773
// touched.
1776
- func (dn * Daemon ) updateFiles (oldIgnConfig , newIgnConfig ign3types.Config , addedOrChangedUnits []ign3types. Unit , skipCertificateWrite bool ) error {
1774
+ func (dn * Daemon ) updateFiles (oldIgnConfig , newIgnConfig ign3types.Config , skipCertificateWrite bool ) error {
1777
1775
klog .Info ("Updating files" )
1778
1776
if err := dn .writeFiles (newIgnConfig .Storage .Files , skipCertificateWrite ); err != nil {
1779
1777
return err
1780
1778
}
1781
- if err := dn .writeUnits (addedOrChangedUnits ); err != nil {
1779
+ if err := dn .writeUnits (newIgnConfig . Systemd . Units ); err != nil {
1782
1780
return err
1783
1781
}
1784
1782
return dn .deleteStaleData (oldIgnConfig , newIgnConfig )
0 commit comments