本文整理汇总了Golang中k8s/io/apimachinery/pkg/conversion.Cloner类的典型用法代码示例。如果您正苦于以下问题:Golang Cloner类的具体用法?Golang Cloner怎么用?Golang Cloner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Cloner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: DeepCopy_v1beta1_SubjectAccessReviewSpec
func DeepCopy_v1beta1_SubjectAccessReviewSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*SubjectAccessReviewSpec)
out := out.(*SubjectAccessReviewSpec)
*out = *in
if in.ResourceAttributes != nil {
in, out := &in.ResourceAttributes, &out.ResourceAttributes
*out = new(ResourceAttributes)
**out = **in
}
if in.NonResourceAttributes != nil {
in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
*out = new(NonResourceAttributes)
**out = **in
}
if in.Groups != nil {
in, out := &in.Groups, &out.Groups
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Extra != nil {
in, out := &in.Extra, &out.Extra
*out = make(map[string]ExtraValue)
for key, val := range *in {
if newVal, err := c.DeepCopy(&val); err != nil {
return err
} else {
(*out)[key] = *newVal.(*ExtraValue)
}
}
}
return nil
}
}
示例2: DeepCopy_v1beta1_StatefulSetSpec
func DeepCopy_v1beta1_StatefulSetSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*StatefulSetSpec)
out := out.(*StatefulSetSpec)
*out = *in
if in.Replicas != nil {
in, out := &in.Replicas, &out.Replicas
*out = new(int32)
**out = **in
}
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
if newVal, err := c.DeepCopy(*in); err != nil {
return err
} else {
*out = newVal.(*v1.LabelSelector)
}
}
if err := api_v1.DeepCopy_v1_PodTemplateSpec(&in.Template, &out.Template, c); err != nil {
return err
}
if in.VolumeClaimTemplates != nil {
in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates
*out = make([]api_v1.PersistentVolumeClaim, len(*in))
for i := range *in {
if err := api_v1.DeepCopy_v1_PersistentVolumeClaim(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
}
return nil
}
}
示例3: DeepCopy_v1alpha1_AdmissionPluginConfiguration
func DeepCopy_v1alpha1_AdmissionPluginConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*AdmissionPluginConfiguration)
out := out.(*AdmissionPluginConfiguration)
*out = *in
if newVal, err := c.DeepCopy(&in.Configuration); err != nil {
return err
} else {
out.Configuration = *newVal.(*runtime.RawExtension)
}
return nil
}
}
示例4: DeepCopy_v1_Scale
func DeepCopy_v1_Scale(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*Scale)
out := out.(*Scale)
*out = *in
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
return nil
}
}
示例5: DeepCopy_v1beta1_DaemonSet
func DeepCopy_v1beta1_DaemonSet(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*DaemonSet)
out := out.(*DaemonSet)
*out = *in
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*v1.ObjectMeta)
}
if err := DeepCopy_v1beta1_DaemonSetSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
return nil
}
}
示例6: DeepCopy_authentication_TokenReview
func DeepCopy_authentication_TokenReview(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*TokenReview)
out := out.(*TokenReview)
*out = *in
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*v1.ObjectMeta)
}
if err := DeepCopy_authentication_TokenReviewStatus(&in.Status, &out.Status, c); err != nil {
return err
}
return nil
}
}
示例7: DeepCopy_v1beta1_SelfSubjectAccessReview
func DeepCopy_v1beta1_SelfSubjectAccessReview(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*SelfSubjectAccessReview)
out := out.(*SelfSubjectAccessReview)
*out = *in
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*v1.ObjectMeta)
}
if err := DeepCopy_v1beta1_SelfSubjectAccessReviewSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
return nil
}
}
示例8: DeepCopy_extensions_Scale
func DeepCopy_extensions_Scale(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*Scale)
out := out.(*Scale)
*out = *in
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*v1.ObjectMeta)
}
if err := DeepCopy_extensions_ScaleStatus(&in.Status, &out.Status, c); err != nil {
return err
}
return nil
}
}
示例9: DeepCopy_extensions_ScaleStatus
func DeepCopy_extensions_ScaleStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ScaleStatus)
out := out.(*ScaleStatus)
*out = *in
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
if newVal, err := c.DeepCopy(*in); err != nil {
return err
} else {
*out = newVal.(*v1.LabelSelector)
}
}
return nil
}
}
示例10: DeepCopy_extensions_PodSecurityPolicy
func DeepCopy_extensions_PodSecurityPolicy(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*PodSecurityPolicy)
out := out.(*PodSecurityPolicy)
*out = *in
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*v1.ObjectMeta)
}
if err := DeepCopy_extensions_PodSecurityPolicySpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
return nil
}
}
示例11: DeepCopy_v1beta1_PodDisruptionBudgetSpec
func DeepCopy_v1beta1_PodDisruptionBudgetSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*PodDisruptionBudgetSpec)
out := out.(*PodDisruptionBudgetSpec)
*out = *in
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
if newVal, err := c.DeepCopy(*in); err != nil {
return err
} else {
*out = newVal.(*v1.LabelSelector)
}
}
return nil
}
}
示例12: DeepCopy_v1_InternalEvent
func DeepCopy_v1_InternalEvent(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*InternalEvent)
out := out.(*InternalEvent)
*out = *in
// in.Object is kind 'Interface'
if in.Object != nil {
if newVal, err := c.DeepCopy(&in.Object); err != nil {
return err
} else {
out.Object = *newVal.(*runtime.Object)
}
}
return nil
}
}
示例13: DeepCopy_v2alpha1_JobTemplateSpec
func DeepCopy_v2alpha1_JobTemplateSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*JobTemplateSpec)
out := out.(*JobTemplateSpec)
*out = *in
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*v1.ObjectMeta)
}
if err := DeepCopy_v2alpha1_JobSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
return nil
}
}
示例14: DeepCopy_componentconfig_AdmissionPluginConfiguration
func DeepCopy_componentconfig_AdmissionPluginConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*AdmissionPluginConfiguration)
out := out.(*AdmissionPluginConfiguration)
*out = *in
// in.Configuration is kind 'Interface'
if in.Configuration != nil {
if newVal, err := c.DeepCopy(&in.Configuration); err != nil {
return err
} else {
out.Configuration = *newVal.(*runtime.Object)
}
}
return nil
}
}
示例15: DeepCopy_apiregistration_APIService
func DeepCopy_apiregistration_APIService(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*APIService)
out := out.(*APIService)
*out = *in
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*v1.ObjectMeta)
}
if err := DeepCopy_apiregistration_APIServiceSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
return nil
}
}