Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed missed interface dependency for SRv6 L2 steering #1469

Merged
merged 2 commits into from
Sep 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}