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
16aeb0b3
Commit
16aeb0b3
authored
4 years ago
by
Manuel Kieweg
Browse files
Options
Downloads
Patches
Plain Diff
plugin SBI kinda works
parent
d20693e8
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!221
Thesis mk
Pipeline
#77771
passed with warnings
4 years ago
Stage: test
Stage: .post
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile.debug
+28
-0
28 additions, 0 deletions
Dockerfile.debug
nucleus/gnmi_transport.go
+1
-1
1 addition, 1 deletion
nucleus/gnmi_transport.go
nucleus/principalNetworkDomain.go
+7
-2
7 additions, 2 deletions
nucleus/principalNetworkDomain.go
with
36 additions
and
3 deletions
Dockerfile.debug
0 → 100644
+
28
−
0
View file @
16aeb0b3
# syntax = docker/dockerfile:1.2
FROM golang:1.16-alpine AS builder
ARG GITLAB_USER
ARG GITLAB_TOKEN
ARG BUILDARGS
WORKDIR /src/gosdn
RUN apk add --no-cache git make build-base
RUN git config --global url."https://$GITLAB_USER:$GITLAB_TOKEN@code.fbi.h-da.de".insteadOf "https://code.fbi.h-da.de"
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build \
GOOS=linux go build -o gosdn ./cmd/gosdn
# Get Delve from a GOPATH not from a Go Modules project
WORKDIR /go/src/
RUN go get github.com/go-delve/delve/cmd/dlv
FROM alpine
EXPOSE 8080
EXPOSE 55055
EXPOSE 40000
COPY --from=builder /src/gosdn /
COPY --from=builder /go/bin/dlv /
CMD ["/dlv", "--listen=:40000", "--headless=true", "--api-version=2", "exec", "/gosdn"]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
nucleus/gnmi_transport.go
+
1
−
1
View file @
16aeb0b3
...
@@ -267,7 +267,7 @@ func (g *Gnmi) ProcessResponse(resp interface{}, root interface{}, s *ytypes.Sch
...
@@ -267,7 +267,7 @@ func (g *Gnmi) ProcessResponse(resp interface{}, root interface{}, s *ytypes.Sch
log
.
Error
(
e
)
log
.
Error
(
e
)
}
}
if
len
(
errs
)
!=
0
{
if
len
(
errs
)
!=
0
{
return
fmt
.
Errorf
(
"encountered %v errors during response processing"
,
len
(
errs
))
return
fmt
.
Errorf
(
"encountered %v errors during response processing
\n
%v
"
,
len
(
errs
)
,
errs
)
}
}
return
nil
return
nil
}
}
...
...
This diff is collapsed.
Click to expand it.
nucleus/principalNetworkDomain.go
+
7
−
2
View file @
16aeb0b3
...
@@ -207,7 +207,7 @@ func (pnd *pndImplementation) AddDevice(name string, opt *tpb.TransportOption, s
...
@@ -207,7 +207,7 @@ func (pnd *pndImplementation) AddDevice(name string, opt *tpb.TransportOption, s
return
pnd
.
handleCsbiEnrolment
(
name
,
opt
)
return
pnd
.
handleCsbiEnrolment
(
name
,
opt
)
case
spb
.
Type_PLUGIN
:
case
spb
.
Type_PLUGIN
:
var
err
error
var
err
error
sbi
,
err
=
pnd
.
handlePluginAttachment
(
name
,
opt
)
sbi
,
err
=
pnd
.
requestPlugin
(
name
,
opt
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -479,7 +479,7 @@ func (pnd *pndImplementation) createCsbiDevice(ctx context.Context, name string,
...
@@ -479,7 +479,7 @@ func (pnd *pndImplementation) createCsbiDevice(ctx context.Context, name string,
return
nil
return
nil
}
}
func
(
pnd
*
pndImplementation
)
handlePluginAttachment
(
name
string
,
opt
*
tpb
.
TransportOption
)
(
southbound
.
SouthboundInterface
,
error
)
{
func
(
pnd
*
pndImplementation
)
requestPlugin
(
name
string
,
opt
*
tpb
.
TransportOption
)
(
southbound
.
SouthboundInterface
,
error
)
{
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
time
.
Minute
*
10
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
time
.
Minute
*
10
)
defer
cancel
()
defer
cancel
()
req
:=
&
cpb
.
CreateRequest
{
req
:=
&
cpb
.
CreateRequest
{
...
@@ -536,5 +536,10 @@ func loadPlugin(id uuid.UUID) (southbound.SouthboundInterface, error) {
...
@@ -536,5 +536,10 @@ func loadPlugin(id uuid.UUID) (southbound.SouthboundInterface, error) {
if
!
ok
{
if
!
ok
{
return
nil
,
&
errors
.
ErrInvalidTypeAssertion
{}
return
nil
,
&
errors
.
ErrInvalidTypeAssertion
{}
}
}
log
.
WithFields
(
log
.
Fields
{
"identifier"
:
sbi
.
SbiIdentifier
(),
"id"
:
sbi
.
ID
(),
"type"
:
sbi
.
Type
(),
})
.
Trace
(
"plugin information"
)
return
sbi
,
nil
return
sbi
,
nil
}
}
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