-
Notifications
You must be signed in to change notification settings - Fork 0
/
namespace.go
40 lines (34 loc) · 1.13 KB
/
namespace.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2023 Volvo Car Corporation
// SPDX-License-Identifier: Apache-2.0
package kubeutil
import (
corev1 "k8s.io/api/core/v1"
)
const (
NSKubeSystem = "kube-system"
NSDefault = "default"
)
// Labels for namespaces
// taken from https://kubernetes.io/docs/tasks/configure-pod-container/enforce-standards-namespace-labels/
const (
NSLabelPodSecurityEnforce = "pod-security.kubernetes.io/enforce"
NSLabelPodSecurityEnforceVersion = "pod-security.kubernetes.io/enforce-version"
NSLabelPodSecurityAudit = "pod-security.kubernetes.io/audit"
NSLabelPodSecurityAuditVersion = "pod-security.kubernetes.io/audit-version"
NSLabelPodSecurityWarn = "pod-security.kubernetes.io/warn"
NSLabelPodSecurityWarnVersion = "pod-security.kubernetes.io/warn-version"
)
const (
NSValuePodSecurityPrivileged = "privileged"
NSValuePodSecurityRestricted = "restricted"
NSValuePodSecurityBaseline = "baseline"
)
func Namespace(
name string,
labels, annotations map[string]string,
) *corev1.Namespace {
return &corev1.Namespace{
TypeMeta: TypeNamespaceV1,
ObjectMeta: ObjectMeta(name, "", labels, annotations),
}
}