Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
goSDN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danet
goSDN
Commits
f691b7cc
Commit
f691b7cc
authored
2 years ago
by
Fabian Seidl
Browse files
Options
Downloads
Patches
Plain Diff
fixed minor issues as renaming, removing import due to review remarks
parent
098b8ebd
No related branches found
No related tags found
1 merge request
!416
Resolve "Refactor how PNDs are implemented in the code"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
controller/controller.go
+2
-4
2 additions, 4 deletions
controller/controller.go
controller/nucleus/networkElementWatcher.go
+4
-4
4 additions, 4 deletions
controller/nucleus/networkElementWatcher.go
with
6 additions
and
8 deletions
controller/controller.go
+
2
−
4
View file @
f691b7cc
...
...
@@ -30,9 +30,7 @@ import (
apb
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/rbac"
tpb
"code.fbi.h-da.de/danet/gosdn/api/go/gosdn/topology"
//TODO: check if both of 'app' are necessary?
"code.fbi.h-da.de/danet/gosdn/controller/app"
apps
"code.fbi.h-da.de/danet/gosdn/controller/app"
"code.fbi.h-da.de/danet/gosdn/controller/config"
"code.fbi.h-da.de/danet/gosdn/controller/conflict"
...
...
@@ -134,7 +132,7 @@ func initialize() error {
routeService
:
routeService
,
eventService
:
eventService
,
pluginService
:
pluginService
,
appService
:
app
s
.
NewAppService
(
app
s
.
NewAppStore
()),
appService
:
app
.
NewAppService
(
app
.
NewAppStore
()),
stopChan
:
make
(
chan
os
.
Signal
,
1
),
pluginRegistryClient
:
pluginRegistryClient
,
}
...
...
@@ -149,7 +147,7 @@ func initialize() error {
}
c
.
networkElementWatcher
=
nucleus
.
NewNetworkElementWatcher
(
c
.
mneService
,
c
.
eventService
)
c
.
networkElementWatcher
.
SubToNetworkElements
(
config
.
GetGnmiSubscriptionPaths
(),
nil
)
c
.
networkElementWatcher
.
Sub
scribe
ToNetworkElements
(
config
.
GetGnmiSubscriptionPaths
(),
nil
)
if
err
:=
ensureDefaultRoleExists
();
err
!=
nil
{
return
err
...
...
This diff is collapsed.
Click to expand it.
controller/nucleus/networkElementWatcher.go
+
4
−
4
View file @
f691b7cc
...
...
@@ -48,10 +48,10 @@ func NewNetworkElementWatcher(mneService networkelement.Service, eventService ev
}
}
// SubToNetworkElements subscribes to every available network element in each network domain according to provided SubscribeOptions.
// Sub
scribe
ToNetworkElements subscribes to every available network element in each network domain according to provided SubscribeOptions.
// Paths should be provided in the following format [][]string{{"system", "config", "hostname"}}
// SubscribeOptions can be nil. Use nil for a fixed, pre-defined set of gNMI subscription options (streaming in sample mode each second).
func
(
n
*
NetworkElementWatcher
)
SubToNetworkElements
(
paths
[][]
string
,
opts
*
gnmi
.
SubscribeOptions
)
{
func
(
n
*
NetworkElementWatcher
)
Sub
scribe
ToNetworkElements
(
paths
[][]
string
,
opts
*
gnmi
.
SubscribeOptions
)
{
if
opts
==
nil
{
opts
=
&
gnmi
.
SubscribeOptions
{
Mode
:
gNMISubscribeMode
,
...
...
@@ -68,11 +68,11 @@ func (n *NetworkElementWatcher) SubToNetworkElements(paths [][]string, opts *gnm
}
for
_
,
mne
:=
range
mnes
{
n
.
subscribeTo
Pnd
NetworkElement
s
(
mne
,
opts
)
n
.
subscribeToNetworkElement
(
mne
,
opts
)
}
}
func
(
n
*
NetworkElementWatcher
)
subscribeTo
Pnd
NetworkElement
s
(
mne
networkelement
.
NetworkElement
,
opts
*
gnmi
.
SubscribeOptions
)
{
func
(
n
*
NetworkElementWatcher
)
subscribeToNetworkElement
(
mne
networkelement
.
NetworkElement
,
opts
*
gnmi
.
SubscribeOptions
)
{
subID
:=
uuid
.
New
()
stopContext
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment