This commit is contained in:
David Eads
2024-06-05 16:50:43 -04:00
committed by Jordan Liggitt
parent 90f0b88b6a
commit f5e5bef2e0
40 changed files with 2449 additions and 399 deletions

View File

@@ -25,6 +25,7 @@ import (
unsafe "unsafe"
v1 "k8s.io/api/authorization/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
authorization "k8s.io/kubernetes/pkg/apis/authorization"
@@ -37,6 +38,26 @@ func init() {
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(s *runtime.Scheme) error {
if err := s.AddGeneratedConversionFunc((*v1.FieldSelectorAttributes)(nil), (*authorization.FieldSelectorAttributes)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_FieldSelectorAttributes_To_authorization_FieldSelectorAttributes(a.(*v1.FieldSelectorAttributes), b.(*authorization.FieldSelectorAttributes), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*authorization.FieldSelectorAttributes)(nil), (*v1.FieldSelectorAttributes)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_authorization_FieldSelectorAttributes_To_v1_FieldSelectorAttributes(a.(*authorization.FieldSelectorAttributes), b.(*v1.FieldSelectorAttributes), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1.LabelSelectorAttributes)(nil), (*authorization.LabelSelectorAttributes)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_LabelSelectorAttributes_To_authorization_LabelSelectorAttributes(a.(*v1.LabelSelectorAttributes), b.(*authorization.LabelSelectorAttributes), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*authorization.LabelSelectorAttributes)(nil), (*v1.LabelSelectorAttributes)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_authorization_LabelSelectorAttributes_To_v1_LabelSelectorAttributes(a.(*authorization.LabelSelectorAttributes), b.(*v1.LabelSelectorAttributes), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1.LocalSubjectAccessReview)(nil), (*authorization.LocalSubjectAccessReview)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_LocalSubjectAccessReview_To_authorization_LocalSubjectAccessReview(a.(*v1.LocalSubjectAccessReview), b.(*authorization.LocalSubjectAccessReview), scope)
}); err != nil {
@@ -170,6 +191,50 @@ func RegisterConversions(s *runtime.Scheme) error {
return nil
}
func autoConvert_v1_FieldSelectorAttributes_To_authorization_FieldSelectorAttributes(in *v1.FieldSelectorAttributes, out *authorization.FieldSelectorAttributes, s conversion.Scope) error {
out.RawSelector = in.RawSelector
out.Requirements = *(*[]metav1.FieldSelectorRequirement)(unsafe.Pointer(&in.Requirements))
return nil
}
// Convert_v1_FieldSelectorAttributes_To_authorization_FieldSelectorAttributes is an autogenerated conversion function.
func Convert_v1_FieldSelectorAttributes_To_authorization_FieldSelectorAttributes(in *v1.FieldSelectorAttributes, out *authorization.FieldSelectorAttributes, s conversion.Scope) error {
return autoConvert_v1_FieldSelectorAttributes_To_authorization_FieldSelectorAttributes(in, out, s)
}
func autoConvert_authorization_FieldSelectorAttributes_To_v1_FieldSelectorAttributes(in *authorization.FieldSelectorAttributes, out *v1.FieldSelectorAttributes, s conversion.Scope) error {
out.RawSelector = in.RawSelector
out.Requirements = *(*[]metav1.FieldSelectorRequirement)(unsafe.Pointer(&in.Requirements))
return nil
}
// Convert_authorization_FieldSelectorAttributes_To_v1_FieldSelectorAttributes is an autogenerated conversion function.
func Convert_authorization_FieldSelectorAttributes_To_v1_FieldSelectorAttributes(in *authorization.FieldSelectorAttributes, out *v1.FieldSelectorAttributes, s conversion.Scope) error {
return autoConvert_authorization_FieldSelectorAttributes_To_v1_FieldSelectorAttributes(in, out, s)
}
func autoConvert_v1_LabelSelectorAttributes_To_authorization_LabelSelectorAttributes(in *v1.LabelSelectorAttributes, out *authorization.LabelSelectorAttributes, s conversion.Scope) error {
out.RawSelector = in.RawSelector
out.Requirements = *(*[]metav1.LabelSelectorRequirement)(unsafe.Pointer(&in.Requirements))
return nil
}
// Convert_v1_LabelSelectorAttributes_To_authorization_LabelSelectorAttributes is an autogenerated conversion function.
func Convert_v1_LabelSelectorAttributes_To_authorization_LabelSelectorAttributes(in *v1.LabelSelectorAttributes, out *authorization.LabelSelectorAttributes, s conversion.Scope) error {
return autoConvert_v1_LabelSelectorAttributes_To_authorization_LabelSelectorAttributes(in, out, s)
}
func autoConvert_authorization_LabelSelectorAttributes_To_v1_LabelSelectorAttributes(in *authorization.LabelSelectorAttributes, out *v1.LabelSelectorAttributes, s conversion.Scope) error {
out.RawSelector = in.RawSelector
out.Requirements = *(*[]metav1.LabelSelectorRequirement)(unsafe.Pointer(&in.Requirements))
return nil
}
// Convert_authorization_LabelSelectorAttributes_To_v1_LabelSelectorAttributes is an autogenerated conversion function.
func Convert_authorization_LabelSelectorAttributes_To_v1_LabelSelectorAttributes(in *authorization.LabelSelectorAttributes, out *v1.LabelSelectorAttributes, s conversion.Scope) error {
return autoConvert_authorization_LabelSelectorAttributes_To_v1_LabelSelectorAttributes(in, out, s)
}
func autoConvert_v1_LocalSubjectAccessReview_To_authorization_LocalSubjectAccessReview(in *v1.LocalSubjectAccessReview, out *authorization.LocalSubjectAccessReview, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_SubjectAccessReviewSpec_To_authorization_SubjectAccessReviewSpec(&in.Spec, &out.Spec, s); err != nil {
@@ -254,6 +319,8 @@ func autoConvert_v1_ResourceAttributes_To_authorization_ResourceAttributes(in *v
out.Resource = in.Resource
out.Subresource = in.Subresource
out.Name = in.Name
out.FieldSelector = (*authorization.FieldSelectorAttributes)(unsafe.Pointer(in.FieldSelector))
out.LabelSelector = (*authorization.LabelSelectorAttributes)(unsafe.Pointer(in.LabelSelector))
return nil
}
@@ -270,6 +337,8 @@ func autoConvert_authorization_ResourceAttributes_To_v1_ResourceAttributes(in *a
out.Resource = in.Resource
out.Subresource = in.Subresource
out.Name = in.Name
out.FieldSelector = (*v1.FieldSelectorAttributes)(unsafe.Pointer(in.FieldSelector))
out.LabelSelector = (*v1.LabelSelectorAttributes)(unsafe.Pointer(in.LabelSelector))
return nil
}