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
a659ac99
Unverified
Commit
a659ac99
authored
Oct 13, 2016
by
Jitendra Bhurat
Committed by
Paulo Pires
Nov 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved getSecurityOpts() function to OS specific manager variant
parent
9ef35289
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
18 deletions
+29
-18
docker_manager.go
pkg/kubelet/dockertools/docker_manager.go
+0
-17
docker_manager_linux.go
pkg/kubelet/dockertools/docker_manager_linux.go
+22
-1
docker_manager_windows.go
pkg/kubelet/dockertools/docker_manager_windows.go
+7
-0
No files found.
pkg/kubelet/dockertools/docker_manager.go
View file @
a659ac99
...
@@ -1113,23 +1113,6 @@ func (dm *DockerManager) fmtDockerOpts(opts []dockerOpt) ([]string, error) {
...
@@ -1113,23 +1113,6 @@ func (dm *DockerManager) fmtDockerOpts(opts []dockerOpt) ([]string, error) {
return
fmtOpts
,
nil
return
fmtOpts
,
nil
}
}
func
(
dm
*
DockerManager
)
getSecurityOpts
(
pod
*
api
.
Pod
,
ctrName
string
)
([]
dockerOpt
,
error
)
{
var
securityOpts
[]
dockerOpt
if
seccompOpts
,
err
:=
dm
.
getSeccompOpts
(
pod
,
ctrName
);
err
!=
nil
{
return
nil
,
err
}
else
{
securityOpts
=
append
(
securityOpts
,
seccompOpts
...
)
}
if
appArmorOpts
,
err
:=
dm
.
getAppArmorOpts
(
pod
,
ctrName
);
err
!=
nil
{
return
nil
,
err
}
else
{
securityOpts
=
append
(
securityOpts
,
appArmorOpts
...
)
}
return
securityOpts
,
nil
}
type
dockerOpt
struct
{
type
dockerOpt
struct
{
// The key-value pair passed to docker.
// The key-value pair passed to docker.
key
,
value
string
key
,
value
string
...
...
pkg/kubelet/dockertools/docker_manager_linux.go
View file @
a659ac99
package
dockertools
package
dockertools
import
dockertypes
"github.com/docker/engine-api/types"
import
(
dockertypes
"github.com/docker/engine-api/types"
"k8s.io/kubernetes/pkg/api"
)
func
getContainerIP
(
container
*
dockertypes
.
ContainerJSON
)
string
{
func
getContainerIP
(
container
*
dockertypes
.
ContainerJSON
)
string
{
result
:=
""
result
:=
""
...
@@ -22,3 +25,21 @@ func getNetworkingMode() string { return "" }
...
@@ -22,3 +25,21 @@ func getNetworkingMode() string { return "" }
func
containerProvidesPodIP
(
name
*
KubeletContainerName
)
bool
{
func
containerProvidesPodIP
(
name
*
KubeletContainerName
)
bool
{
return
name
.
ContainerName
==
PodInfraContainerName
return
name
.
ContainerName
==
PodInfraContainerName
}
}
// Returns Seccomp and AppArmor Security options
func
(
dm
*
DockerManager
)
getSecurityOpts
(
pod
*
api
.
Pod
,
ctrName
string
)
([]
dockerOpt
,
error
)
{
var
securityOpts
[]
dockerOpt
if
seccompOpts
,
err
:=
dm
.
getSeccompOpts
(
pod
,
ctrName
);
err
!=
nil
{
return
nil
,
err
}
else
{
securityOpts
=
append
(
securityOpts
,
seccompOpts
...
)
}
if
appArmorOpts
,
err
:=
dm
.
getAppArmorOpts
(
pod
,
ctrName
);
err
!=
nil
{
return
nil
,
err
}
else
{
securityOpts
=
append
(
securityOpts
,
appArmorOpts
...
)
}
return
securityOpts
,
nil
}
pkg/kubelet/dockertools/docker_manager_windows.go
View file @
a659ac99
...
@@ -3,6 +3,8 @@ package dockertools
...
@@ -3,6 +3,8 @@ package dockertools
import
(
import
(
"os"
"os"
"k8s.io/kubernetes/pkg/api"
dockertypes
"github.com/docker/engine-api/types"
dockertypes
"github.com/docker/engine-api/types"
)
)
...
@@ -31,3 +33,8 @@ func getNetworkingMode() string {
...
@@ -31,3 +33,8 @@ func getNetworkingMode() string {
func
containerProvidesPodIP
(
name
*
KubeletContainerName
)
bool
{
func
containerProvidesPodIP
(
name
*
KubeletContainerName
)
bool
{
return
name
.
ContainerName
!=
PodInfraContainerName
return
name
.
ContainerName
!=
PodInfraContainerName
}
}
// Returns nil as both Seccomp and AppArmor security options are not valid on Windows
func
(
dm
*
DockerManager
)
getSecurityOpts
(
pod
*
api
.
Pod
,
ctrName
string
)
([]
dockerOpt
,
error
)
{
return
nil
,
nil
}
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