mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #23768 from wojtek-t/conversions_with_framework_6
Migrate to new conversions generator - part 2
This commit is contained in:
commit
490c68dbe3
@ -57,9 +57,20 @@ func DefaultNameSystem() string {
|
||||
return "public"
|
||||
}
|
||||
|
||||
var fallbackPackages = []string{
|
||||
"k8s.io/kubernetes/pkg/api/unversioned",
|
||||
"k8s.io/kubernetes/pkg/apis/extensions",
|
||||
}
|
||||
|
||||
func getInternalTypeFor(context *generator.Context, t *types.Type) (*types.Type, bool) {
|
||||
internalPackage := filepath.Dir(t.Name.Package)
|
||||
if !context.Universe.Package(internalPackage).Has(t.Name.Name) {
|
||||
for _, fallbackPackage := range fallbackPackages {
|
||||
if fallbackPackage == t.Name.Package || !context.Universe.Package(fallbackPackage).Has(t.Name.Name) {
|
||||
continue
|
||||
}
|
||||
return context.Universe.Package(fallbackPackage).Type(t.Name.Name), true
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
return context.Universe.Package(internalPackage).Type(t.Name.Name), true
|
||||
@ -148,13 +159,21 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
|
||||
// (in the directory one above) and can be automatically converted to.
|
||||
for _, p := range context.Universe {
|
||||
path := p.Path
|
||||
// TODO: Only a subset of InputDirs is actually where we would like
|
||||
// to generate conversions, the rest of files are added, because either
|
||||
// conversion methods are generated there or they contain types
|
||||
// necessary for conversions.
|
||||
if !inputs.Has(path) {
|
||||
continue
|
||||
}
|
||||
// Only generate conversions for package which explicitly requested it
|
||||
// byt setting "+genversion=true" in their doc.go file.
|
||||
filtered := false
|
||||
for _, comment := range p.DocComments {
|
||||
comment := strings.Trim(comment, "//")
|
||||
if types.ExtractCommentTags("+", comment)["genconversion"] == "true" {
|
||||
filtered = true
|
||||
}
|
||||
}
|
||||
if !filtered {
|
||||
continue
|
||||
}
|
||||
|
||||
convertibleType := false
|
||||
for _, t := range p.Types {
|
||||
@ -165,6 +184,10 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
|
||||
// There is no corresponding type in the internal package.
|
||||
continue
|
||||
}
|
||||
// We won't be able to convert to private type.
|
||||
if namer.IsPrivateGoName(internalType.Name.Name) {
|
||||
continue
|
||||
}
|
||||
// If we can generate conversion in any direction, we should
|
||||
// generate this package.
|
||||
if isConvertible(t, internalType, preexisting) || isConvertible(internalType, t, preexisting) {
|
||||
@ -307,10 +330,11 @@ func (g *genConversion) Namers(c *generator.Context) namer.NameSystems {
|
||||
|
||||
func (g *genConversion) convertibleOnlyWithinPackage(inType, outType *types.Type) bool {
|
||||
var t *types.Type
|
||||
var other *types.Type
|
||||
if inType.Name.Package == g.targetPackage {
|
||||
t = inType
|
||||
t, other = inType, outType
|
||||
} else {
|
||||
t = outType
|
||||
t, other = outType, inType
|
||||
}
|
||||
|
||||
if t.Name.Package != g.targetPackage {
|
||||
@ -324,7 +348,7 @@ func (g *genConversion) convertibleOnlyWithinPackage(inType, outType *types.Type
|
||||
return false
|
||||
}
|
||||
// Also, filter out private types.
|
||||
if namer.IsPrivateGoName(t.Name.Name) {
|
||||
if namer.IsPrivateGoName(other.Name.Name) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
@ -35,6 +35,18 @@ func main() {
|
||||
arguments.InputDirs = []string{
|
||||
"k8s.io/kubernetes/pkg/api/v1",
|
||||
"k8s.io/kubernetes/pkg/api",
|
||||
"k8s.io/kubernetes/pkg/apis/authorization",
|
||||
"k8s.io/kubernetes/pkg/apis/authorization/v1beta1",
|
||||
"k8s.io/kubernetes/pkg/apis/autoscaling",
|
||||
"k8s.io/kubernetes/pkg/apis/autoscaling/v1",
|
||||
"k8s.io/kubernetes/pkg/apis/batch",
|
||||
"k8s.io/kubernetes/pkg/apis/batch/v1",
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig",
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1",
|
||||
"k8s.io/kubernetes/pkg/apis/extensions",
|
||||
"k8s.io/kubernetes/pkg/apis/extensions/v1beta1",
|
||||
"k8s.io/kubernetes/pkg/apis/metrics",
|
||||
"k8s.io/kubernetes/pkg/apis/metrics/v1alpha1",
|
||||
"k8s.io/kubernetes/pkg/conversion",
|
||||
"k8s.io/kubernetes/pkg/runtime",
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ type Builder struct {
|
||||
|
||||
fset *token.FileSet
|
||||
// map of package id to list of parsed files
|
||||
parsed map[string][]*ast.File
|
||||
parsed map[string][]parsedFile
|
||||
|
||||
// Set by makePackages, used by importer() and friends.
|
||||
pkgs map[string]*tc.Package
|
||||
@ -58,6 +58,12 @@ type Builder struct {
|
||||
importGraph map[string]map[string]struct{}
|
||||
}
|
||||
|
||||
// parsedFile is for tracking files with name
|
||||
type parsedFile struct {
|
||||
name string
|
||||
file *ast.File
|
||||
}
|
||||
|
||||
// key type for finding comments.
|
||||
type fileLine struct {
|
||||
file string
|
||||
@ -79,7 +85,7 @@ func New() *Builder {
|
||||
context: &c,
|
||||
buildInfo: map[string]*build.Package{},
|
||||
fset: token.NewFileSet(),
|
||||
parsed: map[string][]*ast.File{},
|
||||
parsed: map[string][]parsedFile{},
|
||||
userRequested: map[string]bool{},
|
||||
endLineToCommentGroup: map[fileLine]*ast.CommentGroup{},
|
||||
importGraph: map[string]map[string]struct{}{},
|
||||
@ -135,7 +141,7 @@ func (b *Builder) addFile(name string, src []byte, userRequested bool) error {
|
||||
return err
|
||||
}
|
||||
pkg := filepath.Dir(name)
|
||||
b.parsed[pkg] = append(b.parsed[pkg], p)
|
||||
b.parsed[pkg] = append(b.parsed[pkg], parsedFile{name, p})
|
||||
b.userRequested[pkg] = userRequested
|
||||
for _, c := range p.Comments {
|
||||
position := b.fset.Position(c.End())
|
||||
@ -272,10 +278,14 @@ func (b *Builder) typeCheckPackage(id string) (*tc.Package, error) {
|
||||
// already processing this package.
|
||||
return nil, fmt.Errorf("circular dependency for %q", id)
|
||||
}
|
||||
files, ok := b.parsed[id]
|
||||
parsedFiles, ok := b.parsed[id]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("No files for pkg %q: %#v", id, b.parsed)
|
||||
}
|
||||
files := make([]*ast.File, len(parsedFiles))
|
||||
for i := range parsedFiles {
|
||||
files[i] = parsedFiles[i].file
|
||||
}
|
||||
b.pkgs[id] = nil
|
||||
c := tc.Config{
|
||||
IgnoreFuncBodies: true,
|
||||
@ -325,6 +335,18 @@ func (b *Builder) FindTypes() (types.Universe, error) {
|
||||
// *packages* they depend on.
|
||||
continue
|
||||
}
|
||||
|
||||
for _, f := range b.parsed[pkgPath] {
|
||||
if strings.HasSuffix(f.name, "/doc.go") {
|
||||
if f.file.Doc != nil {
|
||||
tp := u.Package(pkgPath)
|
||||
for _, c := range f.file.Doc.List {
|
||||
tp.DocComments = append(tp.DocComments, c.Text)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s := pkg.Scope()
|
||||
for _, n := range s.Names() {
|
||||
obj := s.Lookup(n)
|
||||
|
@ -89,6 +89,9 @@ type Package struct {
|
||||
// 'package x' line.
|
||||
Name string
|
||||
|
||||
// Comments from doc.go file.
|
||||
DocComments []string
|
||||
|
||||
// Types within this package, indexed by their name (*not* including
|
||||
// package name).
|
||||
Types map[string]*Type
|
||||
|
@ -43,7 +43,7 @@ EOF
|
||||
}
|
||||
|
||||
# TODO(lavalamp): get this list by listing the pkg/apis/ directory?
|
||||
DEFAULT_GROUP_VERSIONS="authorization/v1beta1 autoscaling/v1 batch/v1 extensions/v1beta1 componentconfig/v1alpha1 metrics/v1alpha1"
|
||||
DEFAULT_GROUP_VERSIONS=""
|
||||
VERSIONS=${VERSIONS:-$DEFAULT_GROUP_VERSIONS}
|
||||
for ver in $VERSIONS; do
|
||||
# Ensure that the version being processed is registered by setting
|
||||
|
@ -15,4 +15,5 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v1 is the v1 version of the API.
|
||||
// +genconversion=true
|
||||
package v1
|
||||
|
@ -1,5 +1,7 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2015 The Kubernetes Authors All rights reserved.
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@ -14,16 +16,377 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS AUTO-GENERATED BY $KUBEROOT/hack/update-generated-conversions.sh
|
||||
// This file was autogenerated by conversion-gen. Do not edit it manually!
|
||||
|
||||
package v1beta1
|
||||
|
||||
import api "k8s.io/kubernetes/pkg/api"
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
authorization "k8s.io/kubernetes/pkg/apis/authorization"
|
||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
func init() {
|
||||
err := api.Scheme.AddGeneratedConversionFuncs()
|
||||
if err != nil {
|
||||
// If one of the conversion functions is malformed, detect it immediately.
|
||||
if err := api.Scheme.AddGeneratedConversionFuncs(
|
||||
Convert_v1beta1_LocalSubjectAccessReview_To_authorization_LocalSubjectAccessReview,
|
||||
Convert_authorization_LocalSubjectAccessReview_To_v1beta1_LocalSubjectAccessReview,
|
||||
Convert_v1beta1_NonResourceAttributes_To_authorization_NonResourceAttributes,
|
||||
Convert_authorization_NonResourceAttributes_To_v1beta1_NonResourceAttributes,
|
||||
Convert_v1beta1_ResourceAttributes_To_authorization_ResourceAttributes,
|
||||
Convert_authorization_ResourceAttributes_To_v1beta1_ResourceAttributes,
|
||||
Convert_v1beta1_SelfSubjectAccessReview_To_authorization_SelfSubjectAccessReview,
|
||||
Convert_authorization_SelfSubjectAccessReview_To_v1beta1_SelfSubjectAccessReview,
|
||||
Convert_v1beta1_SelfSubjectAccessReviewSpec_To_authorization_SelfSubjectAccessReviewSpec,
|
||||
Convert_authorization_SelfSubjectAccessReviewSpec_To_v1beta1_SelfSubjectAccessReviewSpec,
|
||||
Convert_v1beta1_SubjectAccessReview_To_authorization_SubjectAccessReview,
|
||||
Convert_authorization_SubjectAccessReview_To_v1beta1_SubjectAccessReview,
|
||||
Convert_v1beta1_SubjectAccessReviewSpec_To_authorization_SubjectAccessReviewSpec,
|
||||
Convert_authorization_SubjectAccessReviewSpec_To_v1beta1_SubjectAccessReviewSpec,
|
||||
Convert_v1beta1_SubjectAccessReviewStatus_To_authorization_SubjectAccessReviewStatus,
|
||||
Convert_authorization_SubjectAccessReviewStatus_To_v1beta1_SubjectAccessReviewStatus,
|
||||
); err != nil {
|
||||
// if one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_LocalSubjectAccessReview_To_authorization_LocalSubjectAccessReview(in *LocalSubjectAccessReview, out *authorization.LocalSubjectAccessReview, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*LocalSubjectAccessReview))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1beta1_SubjectAccessReviewSpec_To_authorization_SubjectAccessReviewSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1beta1_SubjectAccessReviewStatus_To_authorization_SubjectAccessReviewStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1beta1_LocalSubjectAccessReview_To_authorization_LocalSubjectAccessReview(in *LocalSubjectAccessReview, out *authorization.LocalSubjectAccessReview, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_LocalSubjectAccessReview_To_authorization_LocalSubjectAccessReview(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_authorization_LocalSubjectAccessReview_To_v1beta1_LocalSubjectAccessReview(in *authorization.LocalSubjectAccessReview, out *LocalSubjectAccessReview, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*authorization.LocalSubjectAccessReview))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_authorization_SubjectAccessReviewSpec_To_v1beta1_SubjectAccessReviewSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_authorization_SubjectAccessReviewStatus_To_v1beta1_SubjectAccessReviewStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_authorization_LocalSubjectAccessReview_To_v1beta1_LocalSubjectAccessReview(in *authorization.LocalSubjectAccessReview, out *LocalSubjectAccessReview, s conversion.Scope) error {
|
||||
return autoConvert_authorization_LocalSubjectAccessReview_To_v1beta1_LocalSubjectAccessReview(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_NonResourceAttributes_To_authorization_NonResourceAttributes(in *NonResourceAttributes, out *authorization.NonResourceAttributes, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*NonResourceAttributes))(in)
|
||||
}
|
||||
out.Path = in.Path
|
||||
out.Verb = in.Verb
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1beta1_NonResourceAttributes_To_authorization_NonResourceAttributes(in *NonResourceAttributes, out *authorization.NonResourceAttributes, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_NonResourceAttributes_To_authorization_NonResourceAttributes(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_authorization_NonResourceAttributes_To_v1beta1_NonResourceAttributes(in *authorization.NonResourceAttributes, out *NonResourceAttributes, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*authorization.NonResourceAttributes))(in)
|
||||
}
|
||||
out.Path = in.Path
|
||||
out.Verb = in.Verb
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_authorization_NonResourceAttributes_To_v1beta1_NonResourceAttributes(in *authorization.NonResourceAttributes, out *NonResourceAttributes, s conversion.Scope) error {
|
||||
return autoConvert_authorization_NonResourceAttributes_To_v1beta1_NonResourceAttributes(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_ResourceAttributes_To_authorization_ResourceAttributes(in *ResourceAttributes, out *authorization.ResourceAttributes, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*ResourceAttributes))(in)
|
||||
}
|
||||
out.Namespace = in.Namespace
|
||||
out.Verb = in.Verb
|
||||
out.Group = in.Group
|
||||
out.Version = in.Version
|
||||
out.Resource = in.Resource
|
||||
out.Subresource = in.Subresource
|
||||
out.Name = in.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1beta1_ResourceAttributes_To_authorization_ResourceAttributes(in *ResourceAttributes, out *authorization.ResourceAttributes, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_ResourceAttributes_To_authorization_ResourceAttributes(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_authorization_ResourceAttributes_To_v1beta1_ResourceAttributes(in *authorization.ResourceAttributes, out *ResourceAttributes, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*authorization.ResourceAttributes))(in)
|
||||
}
|
||||
out.Namespace = in.Namespace
|
||||
out.Verb = in.Verb
|
||||
out.Group = in.Group
|
||||
out.Version = in.Version
|
||||
out.Resource = in.Resource
|
||||
out.Subresource = in.Subresource
|
||||
out.Name = in.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_authorization_ResourceAttributes_To_v1beta1_ResourceAttributes(in *authorization.ResourceAttributes, out *ResourceAttributes, s conversion.Scope) error {
|
||||
return autoConvert_authorization_ResourceAttributes_To_v1beta1_ResourceAttributes(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_SelfSubjectAccessReview_To_authorization_SelfSubjectAccessReview(in *SelfSubjectAccessReview, out *authorization.SelfSubjectAccessReview, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*SelfSubjectAccessReview))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1beta1_SelfSubjectAccessReviewSpec_To_authorization_SelfSubjectAccessReviewSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1beta1_SubjectAccessReviewStatus_To_authorization_SubjectAccessReviewStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1beta1_SelfSubjectAccessReview_To_authorization_SelfSubjectAccessReview(in *SelfSubjectAccessReview, out *authorization.SelfSubjectAccessReview, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_SelfSubjectAccessReview_To_authorization_SelfSubjectAccessReview(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_authorization_SelfSubjectAccessReview_To_v1beta1_SelfSubjectAccessReview(in *authorization.SelfSubjectAccessReview, out *SelfSubjectAccessReview, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*authorization.SelfSubjectAccessReview))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_authorization_SelfSubjectAccessReviewSpec_To_v1beta1_SelfSubjectAccessReviewSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_authorization_SubjectAccessReviewStatus_To_v1beta1_SubjectAccessReviewStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_authorization_SelfSubjectAccessReview_To_v1beta1_SelfSubjectAccessReview(in *authorization.SelfSubjectAccessReview, out *SelfSubjectAccessReview, s conversion.Scope) error {
|
||||
return autoConvert_authorization_SelfSubjectAccessReview_To_v1beta1_SelfSubjectAccessReview(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_SelfSubjectAccessReviewSpec_To_authorization_SelfSubjectAccessReviewSpec(in *SelfSubjectAccessReviewSpec, out *authorization.SelfSubjectAccessReviewSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*SelfSubjectAccessReviewSpec))(in)
|
||||
}
|
||||
if in.ResourceAttributes != nil {
|
||||
in, out := &in.ResourceAttributes, &out.ResourceAttributes
|
||||
*out = new(authorization.ResourceAttributes)
|
||||
if err := Convert_v1beta1_ResourceAttributes_To_authorization_ResourceAttributes(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.ResourceAttributes = nil
|
||||
}
|
||||
if in.NonResourceAttributes != nil {
|
||||
in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
|
||||
*out = new(authorization.NonResourceAttributes)
|
||||
if err := Convert_v1beta1_NonResourceAttributes_To_authorization_NonResourceAttributes(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.NonResourceAttributes = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1beta1_SelfSubjectAccessReviewSpec_To_authorization_SelfSubjectAccessReviewSpec(in *SelfSubjectAccessReviewSpec, out *authorization.SelfSubjectAccessReviewSpec, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_SelfSubjectAccessReviewSpec_To_authorization_SelfSubjectAccessReviewSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_authorization_SelfSubjectAccessReviewSpec_To_v1beta1_SelfSubjectAccessReviewSpec(in *authorization.SelfSubjectAccessReviewSpec, out *SelfSubjectAccessReviewSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*authorization.SelfSubjectAccessReviewSpec))(in)
|
||||
}
|
||||
if in.ResourceAttributes != nil {
|
||||
in, out := &in.ResourceAttributes, &out.ResourceAttributes
|
||||
*out = new(ResourceAttributes)
|
||||
if err := Convert_authorization_ResourceAttributes_To_v1beta1_ResourceAttributes(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.ResourceAttributes = nil
|
||||
}
|
||||
if in.NonResourceAttributes != nil {
|
||||
in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
|
||||
*out = new(NonResourceAttributes)
|
||||
if err := Convert_authorization_NonResourceAttributes_To_v1beta1_NonResourceAttributes(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.NonResourceAttributes = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_authorization_SelfSubjectAccessReviewSpec_To_v1beta1_SelfSubjectAccessReviewSpec(in *authorization.SelfSubjectAccessReviewSpec, out *SelfSubjectAccessReviewSpec, s conversion.Scope) error {
|
||||
return autoConvert_authorization_SelfSubjectAccessReviewSpec_To_v1beta1_SelfSubjectAccessReviewSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_SubjectAccessReview_To_authorization_SubjectAccessReview(in *SubjectAccessReview, out *authorization.SubjectAccessReview, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*SubjectAccessReview))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1beta1_SubjectAccessReviewSpec_To_authorization_SubjectAccessReviewSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1beta1_SubjectAccessReviewStatus_To_authorization_SubjectAccessReviewStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1beta1_SubjectAccessReview_To_authorization_SubjectAccessReview(in *SubjectAccessReview, out *authorization.SubjectAccessReview, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_SubjectAccessReview_To_authorization_SubjectAccessReview(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_authorization_SubjectAccessReview_To_v1beta1_SubjectAccessReview(in *authorization.SubjectAccessReview, out *SubjectAccessReview, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*authorization.SubjectAccessReview))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_authorization_SubjectAccessReviewSpec_To_v1beta1_SubjectAccessReviewSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_authorization_SubjectAccessReviewStatus_To_v1beta1_SubjectAccessReviewStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_authorization_SubjectAccessReview_To_v1beta1_SubjectAccessReview(in *authorization.SubjectAccessReview, out *SubjectAccessReview, s conversion.Scope) error {
|
||||
return autoConvert_authorization_SubjectAccessReview_To_v1beta1_SubjectAccessReview(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_SubjectAccessReviewSpec_To_authorization_SubjectAccessReviewSpec(in *SubjectAccessReviewSpec, out *authorization.SubjectAccessReviewSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*SubjectAccessReviewSpec))(in)
|
||||
}
|
||||
if in.ResourceAttributes != nil {
|
||||
in, out := &in.ResourceAttributes, &out.ResourceAttributes
|
||||
*out = new(authorization.ResourceAttributes)
|
||||
if err := Convert_v1beta1_ResourceAttributes_To_authorization_ResourceAttributes(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.ResourceAttributes = nil
|
||||
}
|
||||
if in.NonResourceAttributes != nil {
|
||||
in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
|
||||
*out = new(authorization.NonResourceAttributes)
|
||||
if err := Convert_v1beta1_NonResourceAttributes_To_authorization_NonResourceAttributes(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.NonResourceAttributes = nil
|
||||
}
|
||||
out.User = in.User
|
||||
if in.Groups != nil {
|
||||
in, out := &in.Groups, &out.Groups
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
} else {
|
||||
out.Groups = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1beta1_SubjectAccessReviewSpec_To_authorization_SubjectAccessReviewSpec(in *SubjectAccessReviewSpec, out *authorization.SubjectAccessReviewSpec, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_SubjectAccessReviewSpec_To_authorization_SubjectAccessReviewSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_authorization_SubjectAccessReviewSpec_To_v1beta1_SubjectAccessReviewSpec(in *authorization.SubjectAccessReviewSpec, out *SubjectAccessReviewSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*authorization.SubjectAccessReviewSpec))(in)
|
||||
}
|
||||
if in.ResourceAttributes != nil {
|
||||
in, out := &in.ResourceAttributes, &out.ResourceAttributes
|
||||
*out = new(ResourceAttributes)
|
||||
if err := Convert_authorization_ResourceAttributes_To_v1beta1_ResourceAttributes(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.ResourceAttributes = nil
|
||||
}
|
||||
if in.NonResourceAttributes != nil {
|
||||
in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
|
||||
*out = new(NonResourceAttributes)
|
||||
if err := Convert_authorization_NonResourceAttributes_To_v1beta1_NonResourceAttributes(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.NonResourceAttributes = nil
|
||||
}
|
||||
out.User = in.User
|
||||
if in.Groups != nil {
|
||||
in, out := &in.Groups, &out.Groups
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
} else {
|
||||
out.Groups = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_authorization_SubjectAccessReviewSpec_To_v1beta1_SubjectAccessReviewSpec(in *authorization.SubjectAccessReviewSpec, out *SubjectAccessReviewSpec, s conversion.Scope) error {
|
||||
return autoConvert_authorization_SubjectAccessReviewSpec_To_v1beta1_SubjectAccessReviewSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_SubjectAccessReviewStatus_To_authorization_SubjectAccessReviewStatus(in *SubjectAccessReviewStatus, out *authorization.SubjectAccessReviewStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*SubjectAccessReviewStatus))(in)
|
||||
}
|
||||
out.Allowed = in.Allowed
|
||||
out.Reason = in.Reason
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1beta1_SubjectAccessReviewStatus_To_authorization_SubjectAccessReviewStatus(in *SubjectAccessReviewStatus, out *authorization.SubjectAccessReviewStatus, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_SubjectAccessReviewStatus_To_authorization_SubjectAccessReviewStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_authorization_SubjectAccessReviewStatus_To_v1beta1_SubjectAccessReviewStatus(in *authorization.SubjectAccessReviewStatus, out *SubjectAccessReviewStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*authorization.SubjectAccessReviewStatus))(in)
|
||||
}
|
||||
out.Allowed = in.Allowed
|
||||
out.Reason = in.Reason
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_authorization_SubjectAccessReviewStatus_To_v1beta1_SubjectAccessReviewStatus(in *authorization.SubjectAccessReviewStatus, out *SubjectAccessReviewStatus, s conversion.Scope) error {
|
||||
return autoConvert_authorization_SubjectAccessReviewStatus_To_v1beta1_SubjectAccessReviewStatus(in, out, s)
|
||||
}
|
||||
|
18
pkg/apis/authorization/v1beta1/doc.go
Normal file
18
pkg/apis/authorization/v1beta1/doc.go
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +genconversion=true
|
||||
package v1beta1
|
@ -1,5 +1,7 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2015 The Kubernetes Authors All rights reserved.
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@ -14,171 +16,39 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS AUTO-GENERATED BY $KUBEROOT/hack/update-generated-conversions.sh
|
||||
// This file was autogenerated by conversion-gen. Do not edit it manually!
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
func autoConvert_api_ObjectMeta_To_v1_ObjectMeta(in *api.ObjectMeta, out *v1.ObjectMeta, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*api.ObjectMeta))(in)
|
||||
func init() {
|
||||
if err := api.Scheme.AddGeneratedConversionFuncs(
|
||||
Convert_v1_HorizontalPodAutoscaler_To_extensions_HorizontalPodAutoscaler,
|
||||
Convert_extensions_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler,
|
||||
Convert_v1_HorizontalPodAutoscalerList_To_extensions_HorizontalPodAutoscalerList,
|
||||
Convert_extensions_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutoscalerList,
|
||||
Convert_v1_HorizontalPodAutoscalerSpec_To_extensions_HorizontalPodAutoscalerSpec,
|
||||
Convert_extensions_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec,
|
||||
Convert_v1_HorizontalPodAutoscalerStatus_To_extensions_HorizontalPodAutoscalerStatus,
|
||||
Convert_extensions_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus,
|
||||
Convert_v1_Scale_To_autoscaling_Scale,
|
||||
Convert_autoscaling_Scale_To_v1_Scale,
|
||||
Convert_v1_ScaleSpec_To_autoscaling_ScaleSpec,
|
||||
Convert_autoscaling_ScaleSpec_To_v1_ScaleSpec,
|
||||
Convert_v1_ScaleStatus_To_autoscaling_ScaleStatus,
|
||||
Convert_autoscaling_ScaleStatus_To_v1_ScaleStatus,
|
||||
); err != nil {
|
||||
// if one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
}
|
||||
out.Name = in.Name
|
||||
out.GenerateName = in.GenerateName
|
||||
out.Namespace = in.Namespace
|
||||
out.SelfLink = in.SelfLink
|
||||
out.UID = in.UID
|
||||
out.ResourceVersion = in.ResourceVersion
|
||||
out.Generation = in.Generation
|
||||
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.CreationTimestamp, &out.CreationTimestamp, s); err != nil {
|
||||
return err
|
||||
}
|
||||
// unable to generate simple pointer conversion for unversioned.Time -> unversioned.Time
|
||||
if in.DeletionTimestamp != nil {
|
||||
out.DeletionTimestamp = new(unversioned.Time)
|
||||
if err := api.Convert_unversioned_Time_To_unversioned_Time(in.DeletionTimestamp, out.DeletionTimestamp, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.DeletionTimestamp = nil
|
||||
}
|
||||
if in.DeletionGracePeriodSeconds != nil {
|
||||
out.DeletionGracePeriodSeconds = new(int64)
|
||||
*out.DeletionGracePeriodSeconds = *in.DeletionGracePeriodSeconds
|
||||
} else {
|
||||
out.DeletionGracePeriodSeconds = nil
|
||||
}
|
||||
if in.Labels != nil {
|
||||
out.Labels = make(map[string]string)
|
||||
for key, val := range in.Labels {
|
||||
out.Labels[key] = val
|
||||
}
|
||||
} else {
|
||||
out.Labels = nil
|
||||
}
|
||||
if in.Annotations != nil {
|
||||
out.Annotations = make(map[string]string)
|
||||
for key, val := range in.Annotations {
|
||||
out.Annotations[key] = val
|
||||
}
|
||||
} else {
|
||||
out.Annotations = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_api_ObjectMeta_To_v1_ObjectMeta(in *api.ObjectMeta, out *v1.ObjectMeta, s conversion.Scope) error {
|
||||
return autoConvert_api_ObjectMeta_To_v1_ObjectMeta(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_ObjectMeta_To_api_ObjectMeta(in *v1.ObjectMeta, out *api.ObjectMeta, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*v1.ObjectMeta))(in)
|
||||
}
|
||||
out.Name = in.Name
|
||||
out.GenerateName = in.GenerateName
|
||||
out.Namespace = in.Namespace
|
||||
out.SelfLink = in.SelfLink
|
||||
out.UID = in.UID
|
||||
out.ResourceVersion = in.ResourceVersion
|
||||
out.Generation = in.Generation
|
||||
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.CreationTimestamp, &out.CreationTimestamp, s); err != nil {
|
||||
return err
|
||||
}
|
||||
// unable to generate simple pointer conversion for unversioned.Time -> unversioned.Time
|
||||
if in.DeletionTimestamp != nil {
|
||||
out.DeletionTimestamp = new(unversioned.Time)
|
||||
if err := api.Convert_unversioned_Time_To_unversioned_Time(in.DeletionTimestamp, out.DeletionTimestamp, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.DeletionTimestamp = nil
|
||||
}
|
||||
if in.DeletionGracePeriodSeconds != nil {
|
||||
out.DeletionGracePeriodSeconds = new(int64)
|
||||
*out.DeletionGracePeriodSeconds = *in.DeletionGracePeriodSeconds
|
||||
} else {
|
||||
out.DeletionGracePeriodSeconds = nil
|
||||
}
|
||||
if in.Labels != nil {
|
||||
out.Labels = make(map[string]string)
|
||||
for key, val := range in.Labels {
|
||||
out.Labels[key] = val
|
||||
}
|
||||
} else {
|
||||
out.Labels = nil
|
||||
}
|
||||
if in.Annotations != nil {
|
||||
out.Annotations = make(map[string]string)
|
||||
for key, val := range in.Annotations {
|
||||
out.Annotations[key] = val
|
||||
}
|
||||
} else {
|
||||
out.Annotations = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_ObjectMeta_To_api_ObjectMeta(in *v1.ObjectMeta, out *api.ObjectMeta, s conversion.Scope) error {
|
||||
return autoConvert_v1_ObjectMeta_To_api_ObjectMeta(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_Scale_To_v1_Scale(in *autoscaling.Scale, out *Scale, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*autoscaling.Scale))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_autoscaling_ScaleSpec_To_v1_ScaleSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_autoscaling_ScaleStatus_To_v1_ScaleStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_Scale_To_v1_Scale(in *autoscaling.Scale, out *Scale, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_Scale_To_v1_Scale(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_ScaleSpec_To_v1_ScaleSpec(in *autoscaling.ScaleSpec, out *ScaleSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*autoscaling.ScaleSpec))(in)
|
||||
}
|
||||
out.Replicas = int32(in.Replicas)
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_ScaleSpec_To_v1_ScaleSpec(in *autoscaling.ScaleSpec, out *ScaleSpec, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_ScaleSpec_To_v1_ScaleSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_ScaleStatus_To_v1_ScaleStatus(in *autoscaling.ScaleStatus, out *ScaleStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*autoscaling.ScaleStatus))(in)
|
||||
}
|
||||
out.Replicas = int32(in.Replicas)
|
||||
out.Selector = in.Selector
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_ScaleStatus_To_v1_ScaleStatus(in *autoscaling.ScaleStatus, out *ScaleStatus, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_ScaleStatus_To_v1_ScaleStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_HorizontalPodAutoscaler_To_extensions_HorizontalPodAutoscaler(in *HorizontalPodAutoscaler, out *extensions.HorizontalPodAutoscaler, s conversion.Scope) error {
|
||||
@ -188,7 +58,8 @@ func autoConvert_v1_HorizontalPodAutoscaler_To_extensions_HorizontalPodAutoscale
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
// TODO: Inefficient conversion - can we improve it?
|
||||
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1_HorizontalPodAutoscalerSpec_To_extensions_HorizontalPodAutoscalerSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
@ -204,131 +75,6 @@ func Convert_v1_HorizontalPodAutoscaler_To_extensions_HorizontalPodAutoscaler(in
|
||||
return autoConvert_v1_HorizontalPodAutoscaler_To_extensions_HorizontalPodAutoscaler(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_HorizontalPodAutoscalerList_To_extensions_HorizontalPodAutoscalerList(in *HorizontalPodAutoscalerList, out *extensions.HorizontalPodAutoscalerList, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*HorizontalPodAutoscalerList))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.Items != nil {
|
||||
out.Items = make([]extensions.HorizontalPodAutoscaler, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := Convert_v1_HorizontalPodAutoscaler_To_extensions_HorizontalPodAutoscaler(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_HorizontalPodAutoscalerList_To_extensions_HorizontalPodAutoscalerList(in *HorizontalPodAutoscalerList, out *extensions.HorizontalPodAutoscalerList, s conversion.Scope) error {
|
||||
return autoConvert_v1_HorizontalPodAutoscalerList_To_extensions_HorizontalPodAutoscalerList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_HorizontalPodAutoscalerSpec_To_extensions_HorizontalPodAutoscalerSpec(in *HorizontalPodAutoscalerSpec, out *extensions.HorizontalPodAutoscalerSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*HorizontalPodAutoscalerSpec))(in)
|
||||
}
|
||||
// in.ScaleTargetRef has no peer in out
|
||||
if in.MinReplicas != nil {
|
||||
out.MinReplicas = new(int)
|
||||
*out.MinReplicas = int(*in.MinReplicas)
|
||||
} else {
|
||||
out.MinReplicas = nil
|
||||
}
|
||||
out.MaxReplicas = int(in.MaxReplicas)
|
||||
// in.TargetCPUUtilizationPercentage has no peer in out
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_v1_HorizontalPodAutoscalerStatus_To_extensions_HorizontalPodAutoscalerStatus(in *HorizontalPodAutoscalerStatus, out *extensions.HorizontalPodAutoscalerStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*HorizontalPodAutoscalerStatus))(in)
|
||||
}
|
||||
if in.ObservedGeneration != nil {
|
||||
out.ObservedGeneration = new(int64)
|
||||
*out.ObservedGeneration = *in.ObservedGeneration
|
||||
} else {
|
||||
out.ObservedGeneration = nil
|
||||
}
|
||||
// unable to generate simple pointer conversion for unversioned.Time -> unversioned.Time
|
||||
if in.LastScaleTime != nil {
|
||||
out.LastScaleTime = new(unversioned.Time)
|
||||
if err := api.Convert_unversioned_Time_To_unversioned_Time(in.LastScaleTime, out.LastScaleTime, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.LastScaleTime = nil
|
||||
}
|
||||
out.CurrentReplicas = int(in.CurrentReplicas)
|
||||
out.DesiredReplicas = int(in.DesiredReplicas)
|
||||
if in.CurrentCPUUtilizationPercentage != nil {
|
||||
out.CurrentCPUUtilizationPercentage = new(int)
|
||||
*out.CurrentCPUUtilizationPercentage = int(*in.CurrentCPUUtilizationPercentage)
|
||||
} else {
|
||||
out.CurrentCPUUtilizationPercentage = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_HorizontalPodAutoscalerStatus_To_extensions_HorizontalPodAutoscalerStatus(in *HorizontalPodAutoscalerStatus, out *extensions.HorizontalPodAutoscalerStatus, s conversion.Scope) error {
|
||||
return autoConvert_v1_HorizontalPodAutoscalerStatus_To_extensions_HorizontalPodAutoscalerStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_Scale_To_autoscaling_Scale(in *Scale, out *autoscaling.Scale, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*Scale))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1_ScaleSpec_To_autoscaling_ScaleSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1_ScaleStatus_To_autoscaling_ScaleStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_Scale_To_autoscaling_Scale(in *Scale, out *autoscaling.Scale, s conversion.Scope) error {
|
||||
return autoConvert_v1_Scale_To_autoscaling_Scale(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_ScaleSpec_To_autoscaling_ScaleSpec(in *ScaleSpec, out *autoscaling.ScaleSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*ScaleSpec))(in)
|
||||
}
|
||||
out.Replicas = int(in.Replicas)
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_ScaleSpec_To_autoscaling_ScaleSpec(in *ScaleSpec, out *autoscaling.ScaleSpec, s conversion.Scope) error {
|
||||
return autoConvert_v1_ScaleSpec_To_autoscaling_ScaleSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_ScaleStatus_To_autoscaling_ScaleStatus(in *ScaleStatus, out *autoscaling.ScaleStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*ScaleStatus))(in)
|
||||
}
|
||||
out.Replicas = int(in.Replicas)
|
||||
out.Selector = in.Selector
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_ScaleStatus_To_autoscaling_ScaleStatus(in *ScaleStatus, out *autoscaling.ScaleStatus, s conversion.Scope) error {
|
||||
return autoConvert_v1_ScaleStatus_To_autoscaling_ScaleStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_extensions_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(in *extensions.HorizontalPodAutoscaler, out *HorizontalPodAutoscaler, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*extensions.HorizontalPodAutoscaler))(in)
|
||||
@ -336,7 +82,8 @@ func autoConvert_extensions_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscale
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
// TODO: Inefficient conversion - can we improve it?
|
||||
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_extensions_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
@ -352,6 +99,34 @@ func Convert_extensions_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(in
|
||||
return autoConvert_extensions_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_HorizontalPodAutoscalerList_To_extensions_HorizontalPodAutoscalerList(in *HorizontalPodAutoscalerList, out *extensions.HorizontalPodAutoscalerList, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*HorizontalPodAutoscalerList))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]extensions.HorizontalPodAutoscaler, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_v1_HorizontalPodAutoscaler_To_extensions_HorizontalPodAutoscaler(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_HorizontalPodAutoscalerList_To_extensions_HorizontalPodAutoscalerList(in *HorizontalPodAutoscalerList, out *extensions.HorizontalPodAutoscalerList, s conversion.Scope) error {
|
||||
return autoConvert_v1_HorizontalPodAutoscalerList_To_extensions_HorizontalPodAutoscalerList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_extensions_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutoscalerList(in *extensions.HorizontalPodAutoscalerList, out *HorizontalPodAutoscalerList, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*extensions.HorizontalPodAutoscalerList))(in)
|
||||
@ -363,9 +138,10 @@ func autoConvert_extensions_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutos
|
||||
return err
|
||||
}
|
||||
if in.Items != nil {
|
||||
out.Items = make([]HorizontalPodAutoscaler, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := Convert_extensions_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]HorizontalPodAutoscaler, len(*in))
|
||||
for i := range *in {
|
||||
if err := Convert_extensions_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(&(*in)[i], &(*out)[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@ -379,36 +155,57 @@ func Convert_extensions_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutoscale
|
||||
return autoConvert_extensions_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutoscalerList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_extensions_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec(in *extensions.HorizontalPodAutoscalerSpec, out *HorizontalPodAutoscalerSpec, s conversion.Scope) error {
|
||||
func autoConvert_v1_HorizontalPodAutoscalerStatus_To_extensions_HorizontalPodAutoscalerStatus(in *HorizontalPodAutoscalerStatus, out *extensions.HorizontalPodAutoscalerStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*extensions.HorizontalPodAutoscalerSpec))(in)
|
||||
defaulting.(func(*HorizontalPodAutoscalerStatus))(in)
|
||||
}
|
||||
// in.ScaleRef has no peer in out
|
||||
if in.MinReplicas != nil {
|
||||
out.MinReplicas = new(int32)
|
||||
*out.MinReplicas = int32(*in.MinReplicas)
|
||||
if in.ObservedGeneration != nil {
|
||||
in, out := &in.ObservedGeneration, &out.ObservedGeneration
|
||||
*out = new(int64)
|
||||
**out = **in
|
||||
} else {
|
||||
out.MinReplicas = nil
|
||||
out.ObservedGeneration = nil
|
||||
}
|
||||
if in.LastScaleTime != nil {
|
||||
in, out := &in.LastScaleTime, &out.LastScaleTime
|
||||
*out = new(unversioned.Time)
|
||||
if err := api.Convert_unversioned_Time_To_unversioned_Time(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
out.LastScaleTime = nil
|
||||
}
|
||||
out.CurrentReplicas = int(in.CurrentReplicas)
|
||||
out.DesiredReplicas = int(in.DesiredReplicas)
|
||||
if in.CurrentCPUUtilizationPercentage != nil {
|
||||
in, out := &in.CurrentCPUUtilizationPercentage, &out.CurrentCPUUtilizationPercentage
|
||||
*out = new(int)
|
||||
**out = int(**in)
|
||||
} else {
|
||||
out.CurrentCPUUtilizationPercentage = nil
|
||||
}
|
||||
out.MaxReplicas = int32(in.MaxReplicas)
|
||||
// in.CPUUtilization has no peer in out
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_HorizontalPodAutoscalerStatus_To_extensions_HorizontalPodAutoscalerStatus(in *HorizontalPodAutoscalerStatus, out *extensions.HorizontalPodAutoscalerStatus, s conversion.Scope) error {
|
||||
return autoConvert_v1_HorizontalPodAutoscalerStatus_To_extensions_HorizontalPodAutoscalerStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_extensions_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus(in *extensions.HorizontalPodAutoscalerStatus, out *HorizontalPodAutoscalerStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*extensions.HorizontalPodAutoscalerStatus))(in)
|
||||
}
|
||||
if in.ObservedGeneration != nil {
|
||||
out.ObservedGeneration = new(int64)
|
||||
*out.ObservedGeneration = *in.ObservedGeneration
|
||||
in, out := &in.ObservedGeneration, &out.ObservedGeneration
|
||||
*out = new(int64)
|
||||
**out = **in
|
||||
} else {
|
||||
out.ObservedGeneration = nil
|
||||
}
|
||||
// unable to generate simple pointer conversion for unversioned.Time -> unversioned.Time
|
||||
if in.LastScaleTime != nil {
|
||||
out.LastScaleTime = new(unversioned.Time)
|
||||
if err := api.Convert_unversioned_Time_To_unversioned_Time(in.LastScaleTime, out.LastScaleTime, s); err != nil {
|
||||
in, out := &in.LastScaleTime, &out.LastScaleTime
|
||||
*out = new(unversioned.Time)
|
||||
if err := api.Convert_unversioned_Time_To_unversioned_Time(*in, *out, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
@ -417,8 +214,9 @@ func autoConvert_extensions_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAut
|
||||
out.CurrentReplicas = int32(in.CurrentReplicas)
|
||||
out.DesiredReplicas = int32(in.DesiredReplicas)
|
||||
if in.CurrentCPUUtilizationPercentage != nil {
|
||||
out.CurrentCPUUtilizationPercentage = new(int32)
|
||||
*out.CurrentCPUUtilizationPercentage = int32(*in.CurrentCPUUtilizationPercentage)
|
||||
in, out := &in.CurrentCPUUtilizationPercentage, &out.CurrentCPUUtilizationPercentage
|
||||
*out = new(int32)
|
||||
**out = int32(**in)
|
||||
} else {
|
||||
out.CurrentCPUUtilizationPercentage = nil
|
||||
}
|
||||
@ -429,27 +227,100 @@ func Convert_extensions_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutosca
|
||||
return autoConvert_extensions_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus(in, out, s)
|
||||
}
|
||||
|
||||
func init() {
|
||||
err := api.Scheme.AddGeneratedConversionFuncs(
|
||||
autoConvert_api_ObjectMeta_To_v1_ObjectMeta,
|
||||
autoConvert_autoscaling_ScaleSpec_To_v1_ScaleSpec,
|
||||
autoConvert_autoscaling_ScaleStatus_To_v1_ScaleStatus,
|
||||
autoConvert_autoscaling_Scale_To_v1_Scale,
|
||||
autoConvert_extensions_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutoscalerList,
|
||||
autoConvert_extensions_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec,
|
||||
autoConvert_extensions_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus,
|
||||
autoConvert_extensions_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler,
|
||||
autoConvert_v1_HorizontalPodAutoscalerList_To_extensions_HorizontalPodAutoscalerList,
|
||||
autoConvert_v1_HorizontalPodAutoscalerSpec_To_extensions_HorizontalPodAutoscalerSpec,
|
||||
autoConvert_v1_HorizontalPodAutoscalerStatus_To_extensions_HorizontalPodAutoscalerStatus,
|
||||
autoConvert_v1_HorizontalPodAutoscaler_To_extensions_HorizontalPodAutoscaler,
|
||||
autoConvert_v1_ObjectMeta_To_api_ObjectMeta,
|
||||
autoConvert_v1_ScaleSpec_To_autoscaling_ScaleSpec,
|
||||
autoConvert_v1_ScaleStatus_To_autoscaling_ScaleStatus,
|
||||
autoConvert_v1_Scale_To_autoscaling_Scale,
|
||||
)
|
||||
if err != nil {
|
||||
// If one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
func autoConvert_v1_Scale_To_autoscaling_Scale(in *Scale, out *autoscaling.Scale, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*Scale))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
// TODO: Inefficient conversion - can we improve it?
|
||||
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1_ScaleSpec_To_autoscaling_ScaleSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1_ScaleStatus_To_autoscaling_ScaleStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_Scale_To_autoscaling_Scale(in *Scale, out *autoscaling.Scale, s conversion.Scope) error {
|
||||
return autoConvert_v1_Scale_To_autoscaling_Scale(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_Scale_To_v1_Scale(in *autoscaling.Scale, out *Scale, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*autoscaling.Scale))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
// TODO: Inefficient conversion - can we improve it?
|
||||
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_autoscaling_ScaleSpec_To_v1_ScaleSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_autoscaling_ScaleStatus_To_v1_ScaleStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_Scale_To_v1_Scale(in *autoscaling.Scale, out *Scale, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_Scale_To_v1_Scale(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_ScaleSpec_To_autoscaling_ScaleSpec(in *ScaleSpec, out *autoscaling.ScaleSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*ScaleSpec))(in)
|
||||
}
|
||||
out.Replicas = int(in.Replicas)
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_ScaleSpec_To_autoscaling_ScaleSpec(in *ScaleSpec, out *autoscaling.ScaleSpec, s conversion.Scope) error {
|
||||
return autoConvert_v1_ScaleSpec_To_autoscaling_ScaleSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_ScaleSpec_To_v1_ScaleSpec(in *autoscaling.ScaleSpec, out *ScaleSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*autoscaling.ScaleSpec))(in)
|
||||
}
|
||||
out.Replicas = int32(in.Replicas)
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_ScaleSpec_To_v1_ScaleSpec(in *autoscaling.ScaleSpec, out *ScaleSpec, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_ScaleSpec_To_v1_ScaleSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_ScaleStatus_To_autoscaling_ScaleStatus(in *ScaleStatus, out *autoscaling.ScaleStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*ScaleStatus))(in)
|
||||
}
|
||||
out.Replicas = int(in.Replicas)
|
||||
out.Selector = in.Selector
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1_ScaleStatus_To_autoscaling_ScaleStatus(in *ScaleStatus, out *autoscaling.ScaleStatus, s conversion.Scope) error {
|
||||
return autoConvert_v1_ScaleStatus_To_autoscaling_ScaleStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_autoscaling_ScaleStatus_To_v1_ScaleStatus(in *autoscaling.ScaleStatus, out *ScaleStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*autoscaling.ScaleStatus))(in)
|
||||
}
|
||||
out.Replicas = int32(in.Replicas)
|
||||
out.Selector = in.Selector
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_autoscaling_ScaleStatus_To_v1_ScaleStatus(in *autoscaling.ScaleStatus, out *ScaleStatus, s conversion.Scope) error {
|
||||
return autoConvert_autoscaling_ScaleStatus_To_v1_ScaleStatus(in, out, s)
|
||||
}
|
||||
|
18
pkg/apis/autoscaling/v1/doc.go
Normal file
18
pkg/apis/autoscaling/v1/doc.go
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +genconversion=true
|
||||
package v1
|
@ -20,17 +20,12 @@ import (
|
||||
"fmt"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
"k8s.io/kubernetes/pkg/conversion"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
func addConversionFuncs(scheme *runtime.Scheme) {
|
||||
// Add non-generated conversion functions
|
||||
err := scheme.AddConversionFuncs(
|
||||
Convert_api_PodSpec_To_v1_PodSpec,
|
||||
Convert_v1_PodSpec_To_api_PodSpec,
|
||||
)
|
||||
err := scheme.AddConversionFuncs()
|
||||
if err != nil {
|
||||
// If one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
@ -50,14 +45,3 @@ func addConversionFuncs(scheme *runtime.Scheme) {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// The following two PodSpec conversions functions where copied from pkg/api/conversion.go
|
||||
// for the generated functions to work properly.
|
||||
// This should be fixed: https://github.com/kubernetes/kubernetes/issues/12977
|
||||
func Convert_api_PodSpec_To_v1_PodSpec(in *api.PodSpec, out *v1.PodSpec, s conversion.Scope) error {
|
||||
return v1.Convert_api_PodSpec_To_v1_PodSpec(in, out, s)
|
||||
}
|
||||
|
||||
func Convert_v1_PodSpec_To_api_PodSpec(in *v1.PodSpec, out *api.PodSpec, s conversion.Scope) error {
|
||||
return v1.Convert_v1_PodSpec_To_api_PodSpec(in, out, s)
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
18
pkg/apis/batch/v1/doc.go
Normal file
18
pkg/apis/batch/v1/doc.go
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +genconversion=true
|
||||
package v1
|
@ -1,5 +1,7 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2015 The Kubernetes Authors All rights reserved.
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@ -14,112 +16,29 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS AUTO-GENERATED BY $KUBEROOT/hack/update-generated-conversions.sh
|
||||
// This file was autogenerated by conversion-gen. Do not edit it manually!
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
componentconfig "k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
func autoConvert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration(in *componentconfig.KubeProxyConfiguration, out *KubeProxyConfiguration, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*componentconfig.KubeProxyConfiguration))(in)
|
||||
func init() {
|
||||
if err := api.Scheme.AddGeneratedConversionFuncs(
|
||||
Convert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration,
|
||||
Convert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration,
|
||||
Convert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration,
|
||||
Convert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration,
|
||||
Convert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration,
|
||||
Convert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration,
|
||||
); err != nil {
|
||||
// if one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.BindAddress = in.BindAddress
|
||||
out.HealthzBindAddress = in.HealthzBindAddress
|
||||
out.HealthzPort = int32(in.HealthzPort)
|
||||
out.HostnameOverride = in.HostnameOverride
|
||||
if in.IPTablesMasqueradeBit != nil {
|
||||
out.IPTablesMasqueradeBit = new(int32)
|
||||
*out.IPTablesMasqueradeBit = int32(*in.IPTablesMasqueradeBit)
|
||||
} else {
|
||||
out.IPTablesMasqueradeBit = nil
|
||||
}
|
||||
if err := s.Convert(&in.IPTablesSyncPeriod, &out.IPTablesSyncPeriod, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
out.KubeconfigPath = in.KubeconfigPath
|
||||
out.MasqueradeAll = in.MasqueradeAll
|
||||
out.Master = in.Master
|
||||
if in.OOMScoreAdj != nil {
|
||||
out.OOMScoreAdj = new(int32)
|
||||
*out.OOMScoreAdj = int32(*in.OOMScoreAdj)
|
||||
} else {
|
||||
out.OOMScoreAdj = nil
|
||||
}
|
||||
out.Mode = ProxyMode(in.Mode)
|
||||
out.PortRange = in.PortRange
|
||||
out.ResourceContainer = in.ResourceContainer
|
||||
if err := s.Convert(&in.UDPIdleTimeout, &out.UDPIdleTimeout, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
out.ConntrackMax = int32(in.ConntrackMax)
|
||||
if err := s.Convert(&in.ConntrackTCPEstablishedTimeout, &out.ConntrackTCPEstablishedTimeout, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration(in *componentconfig.KubeProxyConfiguration, out *KubeProxyConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration(in *componentconfig.KubeSchedulerConfiguration, out *KubeSchedulerConfiguration, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*componentconfig.KubeSchedulerConfiguration))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Port = in.Port
|
||||
out.Address = in.Address
|
||||
out.AlgorithmProvider = in.AlgorithmProvider
|
||||
out.PolicyConfigFile = in.PolicyConfigFile
|
||||
if err := api.Convert_bool_To_Pointer_bool(&in.EnableProfiling, &out.EnableProfiling, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.KubeAPIQPS = in.KubeAPIQPS
|
||||
out.KubeAPIBurst = in.KubeAPIBurst
|
||||
out.SchedulerName = in.SchedulerName
|
||||
if err := Convert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration(in *componentconfig.KubeSchedulerConfiguration, out *KubeSchedulerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(in *componentconfig.LeaderElectionConfiguration, out *LeaderElectionConfiguration, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*componentconfig.LeaderElectionConfiguration))(in)
|
||||
}
|
||||
if err := api.Convert_bool_To_Pointer_bool(&in.LeaderElect, &out.LeaderElect, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.Convert(&in.LeaseDuration, &out.LeaseDuration, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.Convert(&in.RenewDeadline, &out.RenewDeadline, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.Convert(&in.RetryPeriod, &out.RetryPeriod, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(in *componentconfig.LeaderElectionConfiguration, out *LeaderElectionConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration(in *KubeProxyConfiguration, out *componentconfig.KubeProxyConfiguration, s conversion.Scope) error {
|
||||
@ -134,11 +53,13 @@ func autoConvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyCon
|
||||
out.HealthzPort = int(in.HealthzPort)
|
||||
out.HostnameOverride = in.HostnameOverride
|
||||
if in.IPTablesMasqueradeBit != nil {
|
||||
out.IPTablesMasqueradeBit = new(int)
|
||||
*out.IPTablesMasqueradeBit = int(*in.IPTablesMasqueradeBit)
|
||||
in, out := &in.IPTablesMasqueradeBit, &out.IPTablesMasqueradeBit
|
||||
*out = new(int)
|
||||
**out = int(**in)
|
||||
} else {
|
||||
out.IPTablesMasqueradeBit = nil
|
||||
}
|
||||
// TODO: Inefficient conversion - can we improve it?
|
||||
if err := s.Convert(&in.IPTablesSyncPeriod, &out.IPTablesSyncPeriod, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -146,18 +67,21 @@ func autoConvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyCon
|
||||
out.MasqueradeAll = in.MasqueradeAll
|
||||
out.Master = in.Master
|
||||
if in.OOMScoreAdj != nil {
|
||||
out.OOMScoreAdj = new(int)
|
||||
*out.OOMScoreAdj = int(*in.OOMScoreAdj)
|
||||
in, out := &in.OOMScoreAdj, &out.OOMScoreAdj
|
||||
*out = new(int)
|
||||
**out = int(**in)
|
||||
} else {
|
||||
out.OOMScoreAdj = nil
|
||||
}
|
||||
out.Mode = componentconfig.ProxyMode(in.Mode)
|
||||
out.PortRange = in.PortRange
|
||||
out.ResourceContainer = in.ResourceContainer
|
||||
// TODO: Inefficient conversion - can we improve it?
|
||||
if err := s.Convert(&in.UDPIdleTimeout, &out.UDPIdleTimeout, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
out.ConntrackMax = int(in.ConntrackMax)
|
||||
// TODO: Inefficient conversion - can we improve it?
|
||||
if err := s.Convert(&in.ConntrackTCPEstablishedTimeout, &out.ConntrackTCPEstablishedTimeout, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -168,6 +92,57 @@ func Convert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfigu
|
||||
return autoConvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration(in *componentconfig.KubeProxyConfiguration, out *KubeProxyConfiguration, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*componentconfig.KubeProxyConfiguration))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.BindAddress = in.BindAddress
|
||||
out.HealthzBindAddress = in.HealthzBindAddress
|
||||
out.HealthzPort = int32(in.HealthzPort)
|
||||
out.HostnameOverride = in.HostnameOverride
|
||||
if in.IPTablesMasqueradeBit != nil {
|
||||
in, out := &in.IPTablesMasqueradeBit, &out.IPTablesMasqueradeBit
|
||||
*out = new(int32)
|
||||
**out = int32(**in)
|
||||
} else {
|
||||
out.IPTablesMasqueradeBit = nil
|
||||
}
|
||||
// TODO: Inefficient conversion - can we improve it?
|
||||
if err := s.Convert(&in.IPTablesSyncPeriod, &out.IPTablesSyncPeriod, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
out.KubeconfigPath = in.KubeconfigPath
|
||||
out.MasqueradeAll = in.MasqueradeAll
|
||||
out.Master = in.Master
|
||||
if in.OOMScoreAdj != nil {
|
||||
in, out := &in.OOMScoreAdj, &out.OOMScoreAdj
|
||||
*out = new(int32)
|
||||
**out = int32(**in)
|
||||
} else {
|
||||
out.OOMScoreAdj = nil
|
||||
}
|
||||
out.Mode = ProxyMode(in.Mode)
|
||||
out.PortRange = in.PortRange
|
||||
out.ResourceContainer = in.ResourceContainer
|
||||
// TODO: Inefficient conversion - can we improve it?
|
||||
if err := s.Convert(&in.UDPIdleTimeout, &out.UDPIdleTimeout, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
out.ConntrackMax = int32(in.ConntrackMax)
|
||||
// TODO: Inefficient conversion - can we improve it?
|
||||
if err := s.Convert(&in.ConntrackTCPEstablishedTimeout, &out.ConntrackTCPEstablishedTimeout, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration(in *componentconfig.KubeProxyConfiguration, out *KubeProxyConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration(in *KubeSchedulerConfiguration, out *componentconfig.KubeSchedulerConfiguration, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*KubeSchedulerConfiguration))(in)
|
||||
@ -195,6 +170,33 @@ func Convert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedule
|
||||
return autoConvert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration(in *componentconfig.KubeSchedulerConfiguration, out *KubeSchedulerConfiguration, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*componentconfig.KubeSchedulerConfiguration))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.Port = in.Port
|
||||
out.Address = in.Address
|
||||
out.AlgorithmProvider = in.AlgorithmProvider
|
||||
out.PolicyConfigFile = in.PolicyConfigFile
|
||||
if err := api.Convert_bool_To_Pointer_bool(&in.EnableProfiling, &out.EnableProfiling, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.KubeAPIQPS = in.KubeAPIQPS
|
||||
out.KubeAPIBurst = in.KubeAPIBurst
|
||||
out.SchedulerName = in.SchedulerName
|
||||
if err := Convert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration(in *componentconfig.KubeSchedulerConfiguration, out *KubeSchedulerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration(in *LeaderElectionConfiguration, out *componentconfig.LeaderElectionConfiguration, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*LeaderElectionConfiguration))(in)
|
||||
@ -202,12 +204,15 @@ func autoConvert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderE
|
||||
if err := api.Convert_Pointer_bool_To_bool(&in.LeaderElect, &out.LeaderElect, s); err != nil {
|
||||
return err
|
||||
}
|
||||
// TODO: Inefficient conversion - can we improve it?
|
||||
if err := s.Convert(&in.LeaseDuration, &out.LeaseDuration, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
// TODO: Inefficient conversion - can we improve it?
|
||||
if err := s.Convert(&in.RenewDeadline, &out.RenewDeadline, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
// TODO: Inefficient conversion - can we improve it?
|
||||
if err := s.Convert(&in.RetryPeriod, &out.RetryPeriod, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -218,17 +223,28 @@ func Convert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElect
|
||||
return autoConvert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
func init() {
|
||||
err := api.Scheme.AddGeneratedConversionFuncs(
|
||||
autoConvert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration,
|
||||
autoConvert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration,
|
||||
autoConvert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration,
|
||||
autoConvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration,
|
||||
autoConvert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration,
|
||||
autoConvert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration,
|
||||
)
|
||||
if err != nil {
|
||||
// If one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
func autoConvert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(in *componentconfig.LeaderElectionConfiguration, out *LeaderElectionConfiguration, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*componentconfig.LeaderElectionConfiguration))(in)
|
||||
}
|
||||
if err := api.Convert_bool_To_Pointer_bool(&in.LeaderElect, &out.LeaderElect, s); err != nil {
|
||||
return err
|
||||
}
|
||||
// TODO: Inefficient conversion - can we improve it?
|
||||
if err := s.Convert(&in.LeaseDuration, &out.LeaseDuration, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
// TODO: Inefficient conversion - can we improve it?
|
||||
if err := s.Convert(&in.RenewDeadline, &out.RenewDeadline, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
// TODO: Inefficient conversion - can we improve it?
|
||||
if err := s.Convert(&in.RetryPeriod, &out.RetryPeriod, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(in *componentconfig.LeaderElectionConfiguration, out *LeaderElectionConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(in, out, s)
|
||||
}
|
||||
|
18
pkg/apis/componentconfig/v1alpha1/doc.go
Normal file
18
pkg/apis/componentconfig/v1alpha1/doc.go
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +genconversion=true
|
||||
package v1alpha1
|
@ -32,8 +32,6 @@ import (
|
||||
func addConversionFuncs(scheme *runtime.Scheme) {
|
||||
// Add non-generated conversion functions
|
||||
err := scheme.AddConversionFuncs(
|
||||
Convert_api_PodSpec_To_v1_PodSpec,
|
||||
Convert_v1_PodSpec_To_api_PodSpec,
|
||||
Convert_extensions_ScaleStatus_To_v1beta1_ScaleStatus,
|
||||
Convert_v1beta1_ScaleStatus_To_extensions_ScaleStatus,
|
||||
Convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec,
|
||||
@ -84,17 +82,6 @@ func addConversionFuncs(scheme *runtime.Scheme) {
|
||||
}
|
||||
}
|
||||
|
||||
// The following two PodSpec conversions functions where copied from pkg/api/conversion.go
|
||||
// for the generated functions to work properly.
|
||||
// This should be fixed: https://github.com/kubernetes/kubernetes/issues/12977
|
||||
func Convert_api_PodSpec_To_v1_PodSpec(in *api.PodSpec, out *v1.PodSpec, s conversion.Scope) error {
|
||||
return v1.Convert_api_PodSpec_To_v1_PodSpec(in, out, s)
|
||||
}
|
||||
|
||||
func Convert_v1_PodSpec_To_api_PodSpec(in *v1.PodSpec, out *api.PodSpec, s conversion.Scope) error {
|
||||
return v1.Convert_v1_PodSpec_To_api_PodSpec(in, out, s)
|
||||
}
|
||||
|
||||
func Convert_extensions_ScaleStatus_To_v1beta1_ScaleStatus(in *extensions.ScaleStatus, out *ScaleStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*extensions.ScaleStatus))(in)
|
||||
@ -371,7 +358,7 @@ func Convert_extensions_JobSpec_To_v1beta1_JobSpec(in *extensions.JobSpec, out *
|
||||
}
|
||||
// END non-standard conversion
|
||||
|
||||
if err := Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
|
||||
if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@ -423,7 +410,7 @@ func Convert_v1beta1_JobSpec_To_extensions_JobSpec(in *JobSpec, out *extensions.
|
||||
}
|
||||
// END non-standard conversion
|
||||
|
||||
if err := Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
|
||||
if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
File diff suppressed because it is too large
Load Diff
18
pkg/apis/extensions/v1beta1/doc.go
Normal file
18
pkg/apis/extensions/v1beta1/doc.go
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +genconversion=true
|
||||
package v1beta1
|
@ -1,5 +1,7 @@
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2015 The Kubernetes Authors All rights reserved.
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@ -14,44 +16,27 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS AUTO-GENERATED BY $KUBEROOT/hack/update-generated-conversions.sh
|
||||
// This file was autogenerated by conversion-gen. Do not edit it manually!
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
metrics "k8s.io/kubernetes/pkg/apis/metrics"
|
||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
func autoConvert_metrics_RawNode_To_v1alpha1_RawNode(in *metrics.RawNode, out *RawNode, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*metrics.RawNode))(in)
|
||||
func init() {
|
||||
if err := api.Scheme.AddGeneratedConversionFuncs(
|
||||
Convert_v1alpha1_RawNode_To_metrics_RawNode,
|
||||
Convert_metrics_RawNode_To_v1alpha1_RawNode,
|
||||
Convert_v1alpha1_RawPod_To_metrics_RawPod,
|
||||
Convert_metrics_RawPod_To_v1alpha1_RawPod,
|
||||
); err != nil {
|
||||
// if one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_metrics_RawNode_To_v1alpha1_RawNode(in *metrics.RawNode, out *RawNode, s conversion.Scope) error {
|
||||
return autoConvert_metrics_RawNode_To_v1alpha1_RawNode(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_metrics_RawPod_To_v1alpha1_RawPod(in *metrics.RawPod, out *RawPod, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*metrics.RawPod))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_metrics_RawPod_To_v1alpha1_RawPod(in *metrics.RawPod, out *RawPod, s conversion.Scope) error {
|
||||
return autoConvert_metrics_RawPod_To_v1alpha1_RawPod(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha1_RawNode_To_metrics_RawNode(in *RawNode, out *metrics.RawNode, s conversion.Scope) error {
|
||||
@ -68,6 +53,20 @@ func Convert_v1alpha1_RawNode_To_metrics_RawNode(in *RawNode, out *metrics.RawNo
|
||||
return autoConvert_v1alpha1_RawNode_To_metrics_RawNode(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_metrics_RawNode_To_v1alpha1_RawNode(in *metrics.RawNode, out *RawNode, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*metrics.RawNode))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_metrics_RawNode_To_v1alpha1_RawNode(in *metrics.RawNode, out *RawNode, s conversion.Scope) error {
|
||||
return autoConvert_metrics_RawNode_To_v1alpha1_RawNode(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha1_RawPod_To_metrics_RawPod(in *RawPod, out *metrics.RawPod, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*RawPod))(in)
|
||||
@ -82,15 +81,16 @@ func Convert_v1alpha1_RawPod_To_metrics_RawPod(in *RawPod, out *metrics.RawPod,
|
||||
return autoConvert_v1alpha1_RawPod_To_metrics_RawPod(in, out, s)
|
||||
}
|
||||
|
||||
func init() {
|
||||
err := api.Scheme.AddGeneratedConversionFuncs(
|
||||
autoConvert_metrics_RawNode_To_v1alpha1_RawNode,
|
||||
autoConvert_metrics_RawPod_To_v1alpha1_RawPod,
|
||||
autoConvert_v1alpha1_RawNode_To_metrics_RawNode,
|
||||
autoConvert_v1alpha1_RawPod_To_metrics_RawPod,
|
||||
)
|
||||
if err != nil {
|
||||
// If one of the conversion functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
func autoConvert_metrics_RawPod_To_v1alpha1_RawPod(in *metrics.RawPod, out *RawPod, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*metrics.RawPod))(in)
|
||||
}
|
||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_metrics_RawPod_To_v1alpha1_RawPod(in *metrics.RawPod, out *RawPod, s conversion.Scope) error {
|
||||
return autoConvert_metrics_RawPod_To_v1alpha1_RawPod(in, out, s)
|
||||
}
|
||||
|
18
pkg/apis/metrics/v1alpha1/doc.go
Normal file
18
pkg/apis/metrics/v1alpha1/doc.go
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +genconversion=true
|
||||
package v1alpha1
|
Loading…
Reference in New Issue
Block a user