Skip to content

Commit

Permalink
Fixed missed interface dependency for SRv6 L2 steering (#1469)
Browse files Browse the repository at this point in the history
* fixed missed interface dependency for SRv6 L2 steering

Signed-off-by: Filip Gschwandtner <[email protected]>

* enhanced panic handling

Signed-off-by: Filip Gschwandtner <[email protected]>
  • Loading branch information
fgschwan authored and ondrej-fabry committed Sep 19, 2019
1 parent 238bab1 commit 9af3996
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions plugins/vpp/srplugin/descriptor/steering.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,24 @@ import (
"reflect"
"strings"

"github.com/pkg/errors"

"github.com/ligato/cn-infra/logging"
vpp_interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces"
"github.com/ligato/vpp-agent/api/models/vpp/l3"
srv6 "github.com/ligato/vpp-agent/api/models/vpp/srv6"
scheduler "github.com/ligato/vpp-agent/plugins/kvscheduler/api"
"github.com/ligato/vpp-agent/plugins/vpp/srplugin/descriptor/adapter"
"github.com/ligato/vpp-agent/plugins/vpp/srplugin/vppcalls"
"github.com/pkg/errors"
)

const (
// SteeringDescriptorName is the name of the descriptor for VPP SRv6 steering
SteeringDescriptorName = "vpp-sr-steering"

// dependency labels
policyExistsDep = "sr-policy-for-steering-exists"
steeringVRFDep = "sr-steering-vrf-table-exists"
policyExistsDep = "sr-policy-for-steering-exists"
steeringVRFDep = "sr-steering-vrf-table-exists"
steeringInterfaceDep = "sr-steering-l2-interface-exists"
)

// SteeringDescriptor teaches KVScheduler how to configure VPP SRv6 steering.
Expand Down Expand Up @@ -215,5 +216,15 @@ func (d *SteeringDescriptor) Dependencies(key string, steering *srv6.Steering) (
})
}
}
// Interface dependency
if l2Traffic := steering.GetL2Traffic(); l2Traffic != nil {
interfaceName := strings.TrimSpace(l2Traffic.InterfaceName)
if len(interfaceName) > 0 {
dependencies = append(dependencies, scheduler.Dependency{
Label: steeringInterfaceDep,
Key: vpp_interfaces.InterfaceKey(interfaceName),
})
}
}
return dependencies
}

0 comments on commit 9af3996

Please sign in to comment.