mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 13:12:20 +00:00
Add HostNetworkSources capability to limit use of HostNetwork.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user