Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
62e4635c
Commit
62e4635c
authored
May 02, 2016
by
Dan Williams
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rkt: set up network namespace with plugins
parent
9b85d20c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
kubelet.go
pkg/kubelet/kubelet.go
+2
-0
rkt.go
pkg/kubelet/rkt/rkt.go
+0
-0
rkt_test.go
pkg/kubelet/rkt/rkt_test.go
+9
-3
No files found.
pkg/kubelet/kubelet.go
View file @
62e4635c
...
...
@@ -439,6 +439,8 @@ func NewMainKubelet(
klet
.
livenessManager
,
klet
.
volumeManager
,
klet
.
httpClient
,
klet
.
networkPlugin
,
klet
.
hairpinMode
==
componentconfig
.
HairpinVeth
,
utilexec
.
New
(),
kubecontainer
.
RealOS
{},
imageBackOff
,
...
...
pkg/kubelet/rkt/rkt.go
View file @
62e4635c
This diff is collapsed.
Click to expand it.
pkg/kubelet/rkt/rkt_test.go
View file @
62e4635c
...
...
@@ -1078,6 +1078,7 @@ func TestGenerateRunCommand(t *testing.T) {
tests
:=
[]
struct
{
pod
*
api
.
Pod
uuid
string
netnsName
string
dnsServers
[]
string
dnsSearches
[]
string
...
...
@@ -1095,6 +1096,7 @@ func TestGenerateRunCommand(t *testing.T) {
Spec
:
api
.
PodSpec
{},
},
"rkt-uuid-foo"
,
"default"
,
[]
string
{},
[]
string
{},
""
,
...
...
@@ -1109,11 +1111,12 @@ func TestGenerateRunCommand(t *testing.T) {
},
},
"rkt-uuid-foo"
,
"default"
,
[]
string
{},
[]
string
{},
"pod-hostname-foo"
,
nil
,
"
/bin/rkt/rkt --insecure-options=image,ondisk --local-config=/var/rkt/local/data --dir=/var/data run-prepared --net=rkt.kubernetes.io
--hostname=pod-hostname-foo rkt-uuid-foo"
,
"
--net=
\"
/var/run/netns/default
\"
-- /bin/rkt/rkt --insecure-options=image,ondisk --local-config=/var/rkt/local/data --dir=/var/data run-prepared --net=host
--hostname=pod-hostname-foo rkt-uuid-foo"
,
},
// Case #2, returns no dns, with host-net.
{
...
...
@@ -1128,6 +1131,7 @@ func TestGenerateRunCommand(t *testing.T) {
},
},
"rkt-uuid-foo"
,
""
,
[]
string
{},
[]
string
{},
""
,
...
...
@@ -1147,11 +1151,12 @@ func TestGenerateRunCommand(t *testing.T) {
},
},
"rkt-uuid-foo"
,
"default"
,
[]
string
{
"127.0.0.1"
},
[]
string
{
"."
},
"pod-hostname-foo"
,
nil
,
"
/bin/rkt/rkt --insecure-options=image,ondisk --local-config=/var/rkt/local/data --dir=/var/data run-prepared --net=rkt.kubernetes.io
--dns=127.0.0.1 --dns-search=. --dns-opt=ndots:5 --hostname=pod-hostname-foo rkt-uuid-foo"
,
"
--net=
\"
/var/run/netns/default
\"
-- /bin/rkt/rkt --insecure-options=image,ondisk --local-config=/var/rkt/local/data --dir=/var/data run-prepared --net=host
--dns=127.0.0.1 --dns-search=. --dns-opt=ndots:5 --hostname=pod-hostname-foo rkt-uuid-foo"
,
},
// Case #4, returns no dns, dns searches, with host-network.
{
...
...
@@ -1166,6 +1171,7 @@ func TestGenerateRunCommand(t *testing.T) {
},
},
"rkt-uuid-foo"
,
""
,
[]
string
{
"127.0.0.1"
},
[]
string
{
"."
},
"pod-hostname-foo"
,
...
...
@@ -1189,7 +1195,7 @@ func TestGenerateRunCommand(t *testing.T) {
testCaseHint
:=
fmt
.
Sprintf
(
"test case #%d"
,
i
)
rkt
.
runtimeHelper
=
&
fakeRuntimeHelper
{
tt
.
dnsServers
,
tt
.
dnsSearches
,
tt
.
hostName
,
""
,
tt
.
err
}
result
,
err
:=
rkt
.
generateRunCommand
(
tt
.
pod
,
tt
.
uuid
)
result
,
err
:=
rkt
.
generateRunCommand
(
tt
.
pod
,
tt
.
uuid
,
tt
.
netnsName
)
assert
.
Equal
(
t
,
tt
.
err
,
err
,
testCaseHint
)
assert
.
Equal
(
t
,
tt
.
expect
,
result
,
testCaseHint
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment