コード例 #1
0
ファイル: util.go プロジェクト: alex-mohr/kubernetes
// Determined whether the specified pod is allowed to use host networking
func allowHostPID(pod *v1.Pod) (bool, error) {
	podSource, err := kubetypes.GetPodSource(pod)
	if err != nil {
		return false, err
	}
	for _, source := range capabilities.Get().PrivilegedSources.HostPIDSources {
		if source == podSource {
			return true, nil
		}
	}
	return false, nil
}
コード例 #2
0
func IsStaticPod(pod *v1.Pod) bool {
	source, err := kubetypes.GetPodSource(pod)
	return err == nil && source != kubetypes.ApiserverSource
}