Add HostNetworkSources capability to limit use of HostNetwork.

This commit is contained in:
Victor Marmol
2015-03-24 16:09:16 -07:00
parent d9cd7a78f7
commit cf7e2756b5
8 changed files with 173 additions and 6 deletions

View File

@@ -24,6 +24,9 @@ import (
// For now these are global. Eventually they may be per-user
type Capabilities struct {
AllowPrivileged bool
// List of pod sources for which using host network is allowed.
HostNetworkSources []string
}
var once sync.Once
@@ -46,7 +49,8 @@ func SetForTests(c Capabilities) {
func Get() Capabilities {
if capabilities == nil {
Initialize(Capabilities{
AllowPrivileged: false,
AllowPrivileged: false,
HostNetworkSources: []string{},
})
}
return *capabilities