本文整理匯總了Golang中k8s/io/kubernetes/pkg/runtime.DeepCopy_runtime_RawExtension函數的典型用法代碼示例。如果您正苦於以下問題:Golang DeepCopy_runtime_RawExtension函數的具體用法?Golang DeepCopy_runtime_RawExtension怎麽用?Golang DeepCopy_runtime_RawExtension使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DeepCopy_runtime_RawExtension函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: DeepCopy_v1_Image
func DeepCopy_v1_Image(in Image, out *Image, c *conversion.Cloner) error {
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
return err
}
if err := api_v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
return err
}
out.DockerImageReference = in.DockerImageReference
if err := runtime.DeepCopy_runtime_RawExtension(in.DockerImageMetadata, &out.DockerImageMetadata, c); err != nil {
return err
}
out.DockerImageMetadataVersion = in.DockerImageMetadataVersion
out.DockerImageManifest = in.DockerImageManifest
if in.DockerImageLayers != nil {
in, out := in.DockerImageLayers, &out.DockerImageLayers
*out = make([]ImageLayer, len(in))
for i := range in {
if err := DeepCopy_v1_ImageLayer(in[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.DockerImageLayers = nil
}
return nil
}
示例2: DeepCopy_v1_AuthorizationAttributes
func DeepCopy_v1_AuthorizationAttributes(in AuthorizationAttributes, out *AuthorizationAttributes, c *conversion.Cloner) error {
out.Namespace = in.Namespace
out.Verb = in.Verb
out.Group = in.Group
out.Version = in.Version
out.Resource = in.Resource
out.ResourceName = in.ResourceName
if err := runtime.DeepCopy_runtime_RawExtension(in.Content, &out.Content, c); err != nil {
return err
}
return nil
}
示例3: DeepCopy_v1_Image
func DeepCopy_v1_Image(in Image, out *Image, c *conversion.Cloner) error {
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
return err
}
if err := api_v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
return err
}
out.DockerImageReference = in.DockerImageReference
if err := runtime.DeepCopy_runtime_RawExtension(in.DockerImageMetadata, &out.DockerImageMetadata, c); err != nil {
return err
}
out.DockerImageMetadataVersion = in.DockerImageMetadataVersion
out.DockerImageManifest = in.DockerImageManifest
if in.DockerImageLayers != nil {
in, out := in.DockerImageLayers, &out.DockerImageLayers
*out = make([]ImageLayer, len(in))
for i := range in {
if err := DeepCopy_v1_ImageLayer(in[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.DockerImageLayers = nil
}
if in.Signatures != nil {
in, out := in.Signatures, &out.Signatures
*out = make([]ImageSignature, len(in))
for i := range in {
if err := DeepCopy_v1_ImageSignature(in[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Signatures = nil
}
if in.DockerImageSignatures != nil {
in, out := in.DockerImageSignatures, &out.DockerImageSignatures
*out = make([][]byte, len(in))
for i := range in {
if newVal, err := c.DeepCopy(in[i]); err != nil {
return err
} else {
(*out)[i] = newVal.([]byte)
}
}
} else {
out.DockerImageSignatures = nil
}
out.DockerImageManifestMediaType = in.DockerImageManifestMediaType
out.DockerImageConfig = in.DockerImageConfig
return nil
}
示例4: DeepCopy_v1_Image
func DeepCopy_v1_Image(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*Image)
out := out.(*Image)
out.TypeMeta = in.TypeMeta
if err := api_v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
return err
}
out.DockerImageReference = in.DockerImageReference
if err := runtime.DeepCopy_runtime_RawExtension(&in.DockerImageMetadata, &out.DockerImageMetadata, c); err != nil {
return err
}
out.DockerImageMetadataVersion = in.DockerImageMetadataVersion
out.DockerImageManifest = in.DockerImageManifest
if in.DockerImageLayers != nil {
in, out := &in.DockerImageLayers, &out.DockerImageLayers
*out = make([]ImageLayer, len(*in))
for i := range *in {
(*out)[i] = (*in)[i]
}
} else {
out.DockerImageLayers = nil
}
if in.Signatures != nil {
in, out := &in.Signatures, &out.Signatures
*out = make([]ImageSignature, len(*in))
for i := range *in {
if err := DeepCopy_v1_ImageSignature(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Signatures = nil
}
if in.DockerImageSignatures != nil {
in, out := &in.DockerImageSignatures, &out.DockerImageSignatures
*out = make([][]byte, len(*in))
for i := range *in {
if newVal, err := c.DeepCopy(&(*in)[i]); err != nil {
return err
} else {
(*out)[i] = *newVal.(*[]byte)
}
}
} else {
out.DockerImageSignatures = nil
}
out.DockerImageManifestMediaType = in.DockerImageManifestMediaType
out.DockerImageConfig = in.DockerImageConfig
return nil
}
}
示例5: DeepCopy_v1_Action
func DeepCopy_v1_Action(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*Action)
out := out.(*Action)
out.Namespace = in.Namespace
out.Verb = in.Verb
out.Group = in.Group
out.Version = in.Version
out.Resource = in.Resource
out.ResourceName = in.ResourceName
if err := runtime.DeepCopy_runtime_RawExtension(&in.Content, &out.Content, c); err != nil {
return err
}
return nil
}
}
示例6: DeepCopy_v1_PolicyRule
func DeepCopy_v1_PolicyRule(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*PolicyRule)
out := out.(*PolicyRule)
if in.Verbs != nil {
in, out := &in.Verbs, &out.Verbs
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.Verbs = nil
}
if err := runtime.DeepCopy_runtime_RawExtension(&in.AttributeRestrictions, &out.AttributeRestrictions, c); err != nil {
return err
}
if in.APIGroups != nil {
in, out := &in.APIGroups, &out.APIGroups
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.APIGroups = nil
}
if in.Resources != nil {
in, out := &in.Resources, &out.Resources
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.Resources = nil
}
if in.ResourceNames != nil {
in, out := &in.ResourceNames, &out.ResourceNames
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.ResourceNames = nil
}
if in.NonResourceURLsSlice != nil {
in, out := &in.NonResourceURLsSlice, &out.NonResourceURLsSlice
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.NonResourceURLsSlice = nil
}
return nil
}
}
示例7: DeepCopy_v1_Template
func DeepCopy_v1_Template(in Template, out *Template, c *conversion.Cloner) error {
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
return err
}
if err := api_v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
return err
}
out.Message = in.Message
if in.Objects != nil {
in, out := in.Objects, &out.Objects
*out = make([]runtime.RawExtension, len(in))
for i := range in {
if err := runtime.DeepCopy_runtime_RawExtension(in[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Objects = nil
}
if in.Parameters != nil {
in, out := in.Parameters, &out.Parameters
*out = make([]Parameter, len(in))
for i := range in {
if err := DeepCopy_v1_Parameter(in[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Parameters = nil
}
if in.ObjectLabels != nil {
in, out := in.ObjectLabels, &out.ObjectLabels
*out = make(map[string]string)
for key, val := range in {
(*out)[key] = val
}
} else {
out.ObjectLabels = nil
}
return nil
}
示例8: DeepCopy_v1alpha1_PolicyRule
func DeepCopy_v1alpha1_PolicyRule(in PolicyRule, out *PolicyRule, c *conversion.Cloner) error {
if in.Verbs != nil {
in, out := in.Verbs, &out.Verbs
*out = make([]string, len(in))
copy(*out, in)
} else {
out.Verbs = nil
}
if err := runtime.DeepCopy_runtime_RawExtension(in.AttributeRestrictions, &out.AttributeRestrictions, c); err != nil {
return err
}
if in.APIGroups != nil {
in, out := in.APIGroups, &out.APIGroups
*out = make([]string, len(in))
copy(*out, in)
} else {
out.APIGroups = nil
}
if in.Resources != nil {
in, out := in.Resources, &out.Resources
*out = make([]string, len(in))
copy(*out, in)
} else {
out.Resources = nil
}
if in.ResourceNames != nil {
in, out := in.ResourceNames, &out.ResourceNames
*out = make([]string, len(in))
copy(*out, in)
} else {
out.ResourceNames = nil
}
if in.NonResourceURLs != nil {
in, out := in.NonResourceURLs, &out.NonResourceURLs
*out = make([]string, len(in))
copy(*out, in)
} else {
out.NonResourceURLs = nil
}
return nil
}
示例9: DeepCopy_v1_Template
func DeepCopy_v1_Template(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*Template)
out := out.(*Template)
out.TypeMeta = in.TypeMeta
if err := api_v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
return err
}
out.Message = in.Message
if in.Objects != nil {
in, out := &in.Objects, &out.Objects
*out = make([]runtime.RawExtension, len(*in))
for i := range *in {
if err := runtime.DeepCopy_runtime_RawExtension(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Objects = nil
}
if in.Parameters != nil {
in, out := &in.Parameters, &out.Parameters
*out = make([]Parameter, len(*in))
for i := range *in {
(*out)[i] = (*in)[i]
}
} else {
out.Parameters = nil
}
if in.ObjectLabels != nil {
in, out := &in.ObjectLabels, &out.ObjectLabels
*out = make(map[string]string)
for key, val := range *in {
(*out)[key] = val
}
} else {
out.ObjectLabels = nil
}
return nil
}
}