Skip to content

Commit

Permalink
PatchEnvelopes: expose only activated patch envelopes to app instance
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
  • Loading branch information
uncleDecart authored and eriknordmark committed Dec 6, 2023
1 parent 09aa0fe commit 284ac58
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/pillar/cmd/zedrouter/patchenvelopes.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ func (pes *PatchEnvelopes) unpublishPatchEnvelopeInfo(peInfo *types.PatchEnvelop
func (pes *PatchEnvelopes) Get(appUUID string) types.PatchEnvelopeInfoList {
var res []types.PatchEnvelopeInfo
pes.currentState.Range(func(patchEnvelopeUUID uuid.UUID, envelope types.PatchEnvelopeInfo) bool {
// We don't want to expose patch envelopes which are not activated to app instance
if envelope.State != types.PatchEnvelopeStateActive {
return true
}
for _, allowedUUID := range envelope.AllowedApps {
if allowedUUID == appUUID {
res = append(res, envelope)
Expand Down

0 comments on commit 284ac58

Please sign in to comment.