Skip to content

Commit

Permalink
Make parse code clear PrevConfigHash
Browse files Browse the repository at this point in the history
Setting to empty byte slice since handlecipherconfig.go did that.

Signed-off-by: eriknordmark <[email protected]>
  • Loading branch information
eriknordmark committed Nov 28, 2023
1 parent 826bb90 commit b60d551
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/pillar/cmd/zedagent/parseconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func parseBaseOS(getconfigCtx *getconfigContext,
log.Functionf("parseBaseOS: deleting %s\n", idStr)
unpublishBaseOsConfig(getconfigCtx, idStr)
}
baseOSPrevConfigHash = nil
baseOSPrevConfigHash = []byte{}
return
}
h := sha256.New()
Expand Down Expand Up @@ -2735,6 +2735,12 @@ func scheduleDeviceOperation(getconfigCtx *getconfigContext, opsCmd *zconfig.Dev

if opsCmd == nil {
removeDeviceOpsCmdConfig(op)
switch op {
case types.DeviceOperationReboot:
rebootPrevConfigHash = []byte{}
case types.DeviceOperationShutdown:
shutdownPrevConfigHash = []byte{}
}
return false
}

Expand Down Expand Up @@ -2823,6 +2829,7 @@ var backupPrevConfigHash []byte
func scheduleBackup(backup *zconfig.DeviceOpsCmd) {
// XXX:FIXME handle backup semantics
if backup == nil {
backupPrevConfigHash = []byte{}
return
}
configHash := computeConfigSha(backup)
Expand Down

0 comments on commit b60d551

Please sign in to comment.