mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-10 08:20:23 +00:00
5ea99fdd5b
This initial version of yamlgen generates deploy/scc.yaml based on the deployment artifact that is provided by the new api/deploy/ocp package. Signed-off-by: Niels de Vos <ndevos@redhat.com>
45 lines
1.3 KiB
Go
45 lines
1.3 KiB
Go
package v1
|
|
|
|
import (
|
|
corev1 "k8s.io/api/core/v1"
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
"k8s.io/apimachinery/pkg/runtime"
|
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
|
)
|
|
|
|
var (
|
|
GroupName = "security.openshift.io"
|
|
GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
|
|
schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, corev1.AddToScheme)
|
|
// Install is a function which adds this version to a scheme
|
|
Install = schemeBuilder.AddToScheme
|
|
|
|
// SchemeGroupVersion generated code relies on this name
|
|
// Deprecated
|
|
SchemeGroupVersion = GroupVersion
|
|
// AddToScheme exists solely to keep the old generators creating valid code
|
|
// DEPRECATED
|
|
AddToScheme = schemeBuilder.AddToScheme
|
|
)
|
|
|
|
// Resource generated code relies on this being here, but it logically belongs to the group
|
|
// DEPRECATED
|
|
func Resource(resource string) schema.GroupResource {
|
|
return schema.GroupResource{Group: GroupName, Resource: resource}
|
|
}
|
|
|
|
// Adds the list of known types to api.Scheme.
|
|
func addKnownTypes(scheme *runtime.Scheme) error {
|
|
scheme.AddKnownTypes(GroupVersion,
|
|
&SecurityContextConstraints{},
|
|
&SecurityContextConstraintsList{},
|
|
&PodSecurityPolicySubjectReview{},
|
|
&PodSecurityPolicySelfSubjectReview{},
|
|
&PodSecurityPolicyReview{},
|
|
&RangeAllocation{},
|
|
&RangeAllocationList{},
|
|
)
|
|
metav1.AddToGroupVersion(scheme, GroupVersion)
|
|
return nil
|
|
}
|