本文整理汇总了Golang中github.com/jchauncey/kubeclient/conversion.Scope.Convert方法的典型用法代码示例。如果您正苦于以下问题:Golang Scope.Convert方法的具体用法?Golang Scope.Convert怎么用?Golang Scope.Convert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/jchauncey/kubeclient/conversion.Scope
的用法示例。
在下文中一共展示了Scope.Convert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Convert_v1beta1_RollingUpdateDaemonSet_To_extensions_RollingUpdateDaemonSet
func Convert_v1beta1_RollingUpdateDaemonSet_To_extensions_RollingUpdateDaemonSet(in *RollingUpdateDaemonSet, out *extensions.RollingUpdateDaemonSet, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*RollingUpdateDaemonSet))(in)
}
if err := s.Convert(in.MaxUnavailable, &out.MaxUnavailable, 0); err != nil {
return err
}
out.MinReadySeconds = int(in.MinReadySeconds)
return nil
}
示例2: Convert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment
func Convert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment(in *extensions.RollingUpdateDeployment, out *RollingUpdateDeployment, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*extensions.RollingUpdateDeployment))(in)
}
if out.MaxUnavailable == nil {
out.MaxUnavailable = &intstr.IntOrString{}
}
if err := s.Convert(&in.MaxUnavailable, out.MaxUnavailable, 0); err != nil {
return err
}
if out.MaxSurge == nil {
out.MaxSurge = &intstr.IntOrString{}
}
if err := s.Convert(&in.MaxSurge, out.MaxSurge, 0); err != nil {
return err
}
out.MinReadySeconds = int32(in.MinReadySeconds)
return nil
}