forked from openshift/oc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
security.go
29 lines (25 loc) · 804 Bytes
/
security.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
package legacy
import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
securityv1 "github.com/openshift/api/security/v1"
)
func InstallExternalLegacySecurity(scheme *runtime.Scheme) {
schemeBuilder := runtime.NewSchemeBuilder(
addUngroupifiedSecurityTypes,
corev1.AddToScheme,
)
utilruntime.Must(schemeBuilder.AddToScheme(scheme))
}
func addUngroupifiedSecurityTypes(scheme *runtime.Scheme) error {
types := []runtime.Object{
&securityv1.SecurityContextConstraints{},
&securityv1.SecurityContextConstraintsList{},
&securityv1.PodSecurityPolicySubjectReview{},
&securityv1.PodSecurityPolicySelfSubjectReview{},
&securityv1.PodSecurityPolicyReview{},
}
scheme.AddKnownTypes(GroupVersion, types...)
return nil
}