Skip to content

Commit

Permalink
parseconfig: set old hash to new only when updated
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Gaiduk <paulg@zededa.com>
  • Loading branch information
europaul authored and eriknordmark committed Feb 23, 2024
1 parent 344853e commit 59aab5e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/pillar/cmd/zedagent/parseconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -2410,15 +2410,16 @@ func parseConfigItems(ctx *getconfigContext, config *zconfig.EdgeDevConfig,
}
configHash := h.Sum(nil)
same := bytes.Equal(configHash, itemsPrevConfigHash)
itemsPrevConfigHash = configHash
if same {
return
}

log.Functionf("parseConfigItems: Applying updated config "+
"prevSha: % x, "+
"NewSha : % x, "+
"items: %v",
itemsPrevConfigHash, configHash, items)
itemsPrevConfigHash = configHash

// Start with the defaults so that we revert to default when no data
// 1) Use the specified Value if no Errors
Expand Down

0 comments on commit 59aab5e

Please sign in to comment.