diff --git a/pkg/scd/models/operational_intents.go b/pkg/scd/models/operational_intents.go index 40d89d993..b14b137e4 100644 --- a/pkg/scd/models/operational_intents.go +++ b/pkg/scd/models/operational_intents.go @@ -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) +} diff --git a/pkg/scd/operational_intents_handler.go b/pkg/scd/operational_intents_handler.go index f7457a867..8ff48deb4 100644 --- a/pkg/scd/operational_intents_handler.go +++ b/pkg/scd/operational_intents_handler.go @@ -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 }