Skip to content

Commit

Permalink
[SCD] Do not require key for accepted op intents of down USSes (#972)
Browse files Browse the repository at this point in the history
  • Loading branch information
mickmis authored Nov 14, 2023
1 parent e712cac commit d0a6b32
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions pkg/scd/models/operational_intents.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,9 @@ func (o *OperationalIntent) SetCells(cids []int64) {
}
o.Cells = cells
}

// RequiresKey indicates whether this OperationalIntent requires its OVN to be included in the provided keys when
// another intersecting OperationalIntent is being created or updated.
func (o *OperationalIntent) RequiresKey() bool {
return !(o.UssAvailability == UssAvailabilityStateDown && o.State == OperationalIntentStateAccepted)
}
3 changes: 2 additions & 1 deletion pkg/scd/operational_intents_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,8 @@ func (a *Server) PutOperationalIntentReference(ctx context.Context, manager stri
return stacktrace.Propagate(err, "Unable to SearchOperations")
}
for _, relevantOp := range relevantOps {
if _, ok := key[relevantOp.OVN]; !ok {
_, ok := key[relevantOp.OVN]
if !ok && relevantOp.RequiresKey() {
if relevantOp.Manager != dssmodels.Manager(manager) {
relevantOp.OVN = scdmodels.NoOvnPhrase
}
Expand Down

0 comments on commit d0a6b32

Please sign in to comment.