示例#1
0
func autoConvert_v1_ClusterRoleScopeRestriction_To_api_ClusterRoleScopeRestriction(in *ClusterRoleScopeRestriction, out *oauth_api.ClusterRoleScopeRestriction, s conversion.Scope) error {
	if in.RoleNames != nil {
		in, out := &in.RoleNames, &out.RoleNames
		*out = make([]string, len(*in))
		copy(*out, *in)
	} else {
		out.RoleNames = nil
	}
	if in.Namespaces != nil {
		in, out := &in.Namespaces, &out.Namespaces
		*out = make([]string, len(*in))
		copy(*out, *in)
	} else {
		out.Namespaces = nil
	}
	out.AllowEscalation = in.AllowEscalation
	return nil
}
func autoConvert_v1_ClusterRoleScopeRestriction_To_api_ClusterRoleScopeRestriction(in *ClusterRoleScopeRestriction, out *oauth_api.ClusterRoleScopeRestriction, s conversion.Scope) error {
	if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
		defaulting.(func(*ClusterRoleScopeRestriction))(in)
	}
	if in.RoleNames != nil {
		in, out := &in.RoleNames, &out.RoleNames
		*out = make([]string, len(*in))
		copy(*out, *in)
	} else {
		out.RoleNames = nil
	}
	if in.Namespaces != nil {
		in, out := &in.Namespaces, &out.Namespaces
		*out = make([]string, len(*in))
		copy(*out, *in)
	} else {
		out.Namespaces = nil
	}
	out.AllowEscalation = in.AllowEscalation
	return nil
}
示例#3
0
func autoConvert_v1_ClusterRoleScopeRestriction_To_api_ClusterRoleScopeRestriction(in *ClusterRoleScopeRestriction, out *api.ClusterRoleScopeRestriction, s conversion.Scope) error {
	out.RoleNames = in.RoleNames
	out.Namespaces = in.Namespaces
	out.AllowEscalation = in.AllowEscalation
	return nil
}
func autoConvert_v1_ClusterRoleScopeRestriction_To_api_ClusterRoleScopeRestriction(in *ClusterRoleScopeRestriction, out *api.ClusterRoleScopeRestriction, s conversion.Scope) error {
	out.RoleNames = *(*[]string)(unsafe.Pointer(&in.RoleNames))
	out.Namespaces = *(*[]string)(unsafe.Pointer(&in.Namespaces))
	out.AllowEscalation = in.AllowEscalation
	return nil
}