Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
7448cc04
Commit
7448cc04
authored
Apr 01, 2016
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to new generator
parent
cd2de7d4
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
197 additions
and
44 deletions
+197
-44
conversion.go
cmd/libs/go2idl/conversion-gen/generators/conversion.go
+31
-7
main.go
cmd/libs/go2idl/conversion-gen/main.go
+12
-0
parse.go
cmd/libs/go2idl/parser/parse.go
+26
-4
types.go
cmd/libs/go2idl/types/types.go
+3
-0
update-generated-conversions.sh
hack/after-build/update-generated-conversions.sh
+1
-1
doc.go
pkg/api/v1/doc.go
+1
-0
conversion_generated.go
pkg/apis/authorization/v1beta1/conversion_generated.go
+2
-0
doc.go
pkg/apis/authorization/v1beta1/doc.go
+18
-0
conversion_generated.go
pkg/apis/autoscaling/v1/conversion_generated.go
+2
-0
doc.go
pkg/apis/autoscaling/v1/doc.go
+18
-0
conversion.go
pkg/apis/batch/v1/conversion.go
+1
-17
conversion_generated.go
pkg/apis/batch/v1/conversion_generated.go
+2
-0
doc.go
pkg/apis/batch/v1/doc.go
+18
-0
conversion_generated.go
pkg/apis/componentconfig/v1alpha1/conversion_generated.go
+2
-0
doc.go
pkg/apis/componentconfig/v1alpha1/doc.go
+18
-0
conversion.go
pkg/apis/extensions/v1beta1/conversion.go
+2
-15
conversion_generated.go
pkg/apis/extensions/v1beta1/conversion_generated.go
+2
-0
doc.go
pkg/apis/extensions/v1beta1/doc.go
+18
-0
conversion_generated.go
pkg/apis/metrics/v1alpha1/conversion_generated.go
+2
-0
doc.go
pkg/apis/metrics/v1alpha1/doc.go
+18
-0
No files found.
cmd/libs/go2idl/conversion-gen/generators/conversion.go
View file @
7448cc04
...
@@ -57,9 +57,20 @@ func DefaultNameSystem() string {
...
@@ -57,9 +57,20 @@ func DefaultNameSystem() string {
return
"public"
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
)
{
func
getInternalTypeFor
(
context
*
generator
.
Context
,
t
*
types
.
Type
)
(
*
types
.
Type
,
bool
)
{
internalPackage
:=
filepath
.
Dir
(
t
.
Name
.
Package
)
internalPackage
:=
filepath
.
Dir
(
t
.
Name
.
Package
)
if
!
context
.
Universe
.
Package
(
internalPackage
)
.
Has
(
t
.
Name
.
Name
)
{
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
nil
,
false
}
}
return
context
.
Universe
.
Package
(
internalPackage
)
.
Type
(
t
.
Name
.
Name
),
true
return
context
.
Universe
.
Package
(
internalPackage
)
.
Type
(
t
.
Name
.
Name
),
true
...
@@ -149,13 +160,21 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
...
@@ -149,13 +160,21 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
// (in the directory one above) and can be automatically converted to.
// (in the directory one above) and can be automatically converted to.
for
_
,
p
:=
range
context
.
Universe
{
for
_
,
p
:=
range
context
.
Universe
{
path
:=
p
.
Path
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
)
{
if
!
inputs
.
Has
(
path
)
{
continue
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
convertibleType
:=
false
for
_
,
t
:=
range
p
.
Types
{
for
_
,
t
:=
range
p
.
Types
{
...
@@ -166,6 +185,10 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
...
@@ -166,6 +185,10 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
// There is no corresponding type in the internal package.
// There is no corresponding type in the internal package.
continue
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
// If we can generate conversion in any direction, we should
// generate this package.
// generate this package.
if
isConvertible
(
t
,
internalType
,
preexisting
)
||
isConvertible
(
internalType
,
t
,
preexisting
)
{
if
isConvertible
(
t
,
internalType
,
preexisting
)
||
isConvertible
(
internalType
,
t
,
preexisting
)
{
...
@@ -308,10 +331,11 @@ func (g *genConversion) Namers(c *generator.Context) namer.NameSystems {
...
@@ -308,10 +331,11 @@ func (g *genConversion) Namers(c *generator.Context) namer.NameSystems {
func
(
g
*
genConversion
)
convertibleOnlyWithinPackage
(
inType
,
outType
*
types
.
Type
)
bool
{
func
(
g
*
genConversion
)
convertibleOnlyWithinPackage
(
inType
,
outType
*
types
.
Type
)
bool
{
var
t
*
types
.
Type
var
t
*
types
.
Type
var
other
*
types
.
Type
if
inType
.
Name
.
Package
==
g
.
targetPackage
{
if
inType
.
Name
.
Package
==
g
.
targetPackage
{
t
=
in
Type
t
,
other
=
inType
,
out
Type
}
else
{
}
else
{
t
=
out
Type
t
,
other
=
outType
,
in
Type
}
}
if
t
.
Name
.
Package
!=
g
.
targetPackage
{
if
t
.
Name
.
Package
!=
g
.
targetPackage
{
...
@@ -325,7 +349,7 @@ func (g *genConversion) convertibleOnlyWithinPackage(inType, outType *types.Type
...
@@ -325,7 +349,7 @@ func (g *genConversion) convertibleOnlyWithinPackage(inType, outType *types.Type
return
false
return
false
}
}
// Also, filter out private types.
// Also, filter out private types.
if
namer
.
IsPrivateGoName
(
t
.
Name
.
Name
)
{
if
namer
.
IsPrivateGoName
(
other
.
Name
.
Name
)
{
return
false
return
false
}
}
return
true
return
true
...
...
cmd/libs/go2idl/conversion-gen/main.go
View file @
7448cc04
...
@@ -35,6 +35,18 @@ func main() {
...
@@ -35,6 +35,18 @@ func main() {
arguments
.
InputDirs
=
[]
string
{
arguments
.
InputDirs
=
[]
string
{
"k8s.io/kubernetes/pkg/api/v1"
,
"k8s.io/kubernetes/pkg/api/v1"
,
"k8s.io/kubernetes/pkg/api"
,
"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/conversion"
,
"k8s.io/kubernetes/pkg/runtime"
,
"k8s.io/kubernetes/pkg/runtime"
,
}
}
...
...
cmd/libs/go2idl/parser/parse.go
View file @
7448cc04
...
@@ -42,7 +42,7 @@ type Builder struct {
...
@@ -42,7 +42,7 @@ type Builder struct {
fset
*
token
.
FileSet
fset
*
token
.
FileSet
// map of package id to list of parsed files
// map of package id to list of parsed files
parsed
map
[
string
][]
*
ast
.
File
parsed
map
[
string
][]
parsed
File
// Set by makePackages, used by importer() and friends.
// Set by makePackages, used by importer() and friends.
pkgs
map
[
string
]
*
tc
.
Package
pkgs
map
[
string
]
*
tc
.
Package
...
@@ -58,6 +58,12 @@ type Builder struct {
...
@@ -58,6 +58,12 @@ type Builder struct {
importGraph
map
[
string
]
map
[
string
]
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.
// key type for finding comments.
type
fileLine
struct
{
type
fileLine
struct
{
file
string
file
string
...
@@ -79,7 +85,7 @@ func New() *Builder {
...
@@ -79,7 +85,7 @@ func New() *Builder {
context
:
&
c
,
context
:
&
c
,
buildInfo
:
map
[
string
]
*
build
.
Package
{},
buildInfo
:
map
[
string
]
*
build
.
Package
{},
fset
:
token
.
NewFileSet
(),
fset
:
token
.
NewFileSet
(),
parsed
:
map
[
string
][]
*
ast
.
File
{},
parsed
:
map
[
string
][]
parsed
File
{},
userRequested
:
map
[
string
]
bool
{},
userRequested
:
map
[
string
]
bool
{},
endLineToCommentGroup
:
map
[
fileLine
]
*
ast
.
CommentGroup
{},
endLineToCommentGroup
:
map
[
fileLine
]
*
ast
.
CommentGroup
{},
importGraph
:
map
[
string
]
map
[
string
]
struct
{}{},
importGraph
:
map
[
string
]
map
[
string
]
struct
{}{},
...
@@ -135,7 +141,7 @@ func (b *Builder) addFile(name string, src []byte, userRequested bool) error {
...
@@ -135,7 +141,7 @@ func (b *Builder) addFile(name string, src []byte, userRequested bool) error {
return
err
return
err
}
}
pkg
:=
filepath
.
Dir
(
name
)
pkg
:=
filepath
.
Dir
(
name
)
b
.
parsed
[
pkg
]
=
append
(
b
.
parsed
[
pkg
],
p
)
b
.
parsed
[
pkg
]
=
append
(
b
.
parsed
[
pkg
],
p
arsedFile
{
name
,
p
}
)
b
.
userRequested
[
pkg
]
=
userRequested
b
.
userRequested
[
pkg
]
=
userRequested
for
_
,
c
:=
range
p
.
Comments
{
for
_
,
c
:=
range
p
.
Comments
{
position
:=
b
.
fset
.
Position
(
c
.
End
())
position
:=
b
.
fset
.
Position
(
c
.
End
())
...
@@ -272,10 +278,14 @@ func (b *Builder) typeCheckPackage(id string) (*tc.Package, error) {
...
@@ -272,10 +278,14 @@ func (b *Builder) typeCheckPackage(id string) (*tc.Package, error) {
// already processing this package.
// already processing this package.
return
nil
,
fmt
.
Errorf
(
"circular dependency for %q"
,
id
)
return
nil
,
fmt
.
Errorf
(
"circular dependency for %q"
,
id
)
}
}
f
iles
,
ok
:=
b
.
parsed
[
id
]
parsedF
iles
,
ok
:=
b
.
parsed
[
id
]
if
!
ok
{
if
!
ok
{
return
nil
,
fmt
.
Errorf
(
"No files for pkg %q: %#v"
,
id
,
b
.
parsed
)
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
b
.
pkgs
[
id
]
=
nil
c
:=
tc
.
Config
{
c
:=
tc
.
Config
{
IgnoreFuncBodies
:
true
,
IgnoreFuncBodies
:
true
,
...
@@ -325,6 +335,18 @@ func (b *Builder) FindTypes() (types.Universe, error) {
...
@@ -325,6 +335,18 @@ func (b *Builder) FindTypes() (types.Universe, error) {
// *packages* they depend on.
// *packages* they depend on.
continue
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
()
s
:=
pkg
.
Scope
()
for
_
,
n
:=
range
s
.
Names
()
{
for
_
,
n
:=
range
s
.
Names
()
{
obj
:=
s
.
Lookup
(
n
)
obj
:=
s
.
Lookup
(
n
)
...
...
cmd/libs/go2idl/types/types.go
View file @
7448cc04
...
@@ -89,6 +89,9 @@ type Package struct {
...
@@ -89,6 +89,9 @@ type Package struct {
// 'package x' line.
// 'package x' line.
Name
string
Name
string
// Comments from doc.go file.
DocComments
[]
string
// Types within this package, indexed by their name (*not* including
// Types within this package, indexed by their name (*not* including
// package name).
// package name).
Types
map
[
string
]
*
Type
Types
map
[
string
]
*
Type
...
...
hack/after-build/update-generated-conversions.sh
View file @
7448cc04
...
@@ -43,7 +43,7 @@ EOF
...
@@ -43,7 +43,7 @@ EOF
}
}
# TODO(lavalamp): get this list by listing the pkg/apis/ directory?
# 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
}
VERSIONS
=
${
VERSIONS
:-
$DEFAULT_GROUP_VERSIONS
}
for
ver
in
$VERSIONS
;
do
for
ver
in
$VERSIONS
;
do
# Ensure that the version being processed is registered by setting
# Ensure that the version being processed is registered by setting
...
...
pkg/api/v1/doc.go
View file @
7448cc04
...
@@ -15,4 +15,5 @@ limitations under the License.
...
@@ -15,4 +15,5 @@ limitations under the License.
*/
*/
// Package v1 is the v1 version of the API.
// Package v1 is the v1 version of the API.
// +genconversion=true
package
v1
package
v1
pkg/apis/authorization/v1beta1/conversion_generated.go
View file @
7448cc04
// +build !ignore_autogenerated
/*
/*
Copyright 2015 The Kubernetes Authors All rights reserved.
Copyright 2015 The Kubernetes Authors All rights reserved.
...
...
pkg/apis/authorization/v1beta1/doc.go
0 → 100644
View file @
7448cc04
/*
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
pkg/apis/autoscaling/v1/conversion_generated.go
View file @
7448cc04
// +build !ignore_autogenerated
/*
/*
Copyright 2015 The Kubernetes Authors All rights reserved.
Copyright 2015 The Kubernetes Authors All rights reserved.
...
...
pkg/apis/autoscaling/v1/doc.go
0 → 100644
View file @
7448cc04
/*
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
pkg/apis/batch/v1/conversion.go
View file @
7448cc04
...
@@ -20,17 +20,12 @@ import (
...
@@ -20,17 +20,12 @@ import (
"fmt"
"fmt"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
v1
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/conversion"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/runtime"
)
)
func
addConversionFuncs
(
scheme
*
runtime
.
Scheme
)
{
func
addConversionFuncs
(
scheme
*
runtime
.
Scheme
)
{
// Add non-generated conversion functions
// Add non-generated conversion functions
err
:=
scheme
.
AddConversionFuncs
(
err
:=
scheme
.
AddConversionFuncs
()
Convert_api_PodSpec_To_v1_PodSpec
,
Convert_v1_PodSpec_To_api_PodSpec
,
)
if
err
!=
nil
{
if
err
!=
nil
{
// If one of the conversion functions is malformed, detect it immediately.
// If one of the conversion functions is malformed, detect it immediately.
panic
(
err
)
panic
(
err
)
...
@@ -50,14 +45,3 @@ func addConversionFuncs(scheme *runtime.Scheme) {
...
@@ -50,14 +45,3 @@ func addConversionFuncs(scheme *runtime.Scheme) {
panic
(
err
)
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
)
}
pkg/apis/batch/v1/conversion_generated.go
View file @
7448cc04
// +build !ignore_autogenerated
/*
/*
Copyright 2015 The Kubernetes Authors All rights reserved.
Copyright 2015 The Kubernetes Authors All rights reserved.
...
...
pkg/apis/batch/v1/doc.go
0 → 100644
View file @
7448cc04
/*
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
pkg/apis/componentconfig/v1alpha1/conversion_generated.go
View file @
7448cc04
// +build !ignore_autogenerated
/*
/*
Copyright 2015 The Kubernetes Authors All rights reserved.
Copyright 2015 The Kubernetes Authors All rights reserved.
...
...
pkg/apis/componentconfig/v1alpha1/doc.go
0 → 100644
View file @
7448cc04
/*
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
pkg/apis/extensions/v1beta1/conversion.go
View file @
7448cc04
...
@@ -32,8 +32,6 @@ import (
...
@@ -32,8 +32,6 @@ import (
func
addConversionFuncs
(
scheme
*
runtime
.
Scheme
)
{
func
addConversionFuncs
(
scheme
*
runtime
.
Scheme
)
{
// Add non-generated conversion functions
// Add non-generated conversion functions
err
:=
scheme
.
AddConversionFuncs
(
err
:=
scheme
.
AddConversionFuncs
(
Convert_api_PodSpec_To_v1_PodSpec
,
Convert_v1_PodSpec_To_api_PodSpec
,
Convert_extensions_ScaleStatus_To_v1beta1_ScaleStatus
,
Convert_extensions_ScaleStatus_To_v1beta1_ScaleStatus
,
Convert_v1beta1_ScaleStatus_To_extensions_ScaleStatus
,
Convert_v1beta1_ScaleStatus_To_extensions_ScaleStatus
,
Convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec
,
Convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec
,
...
@@ -84,17 +82,6 @@ func addConversionFuncs(scheme *runtime.Scheme) {
...
@@ -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
{
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
{
if
defaulting
,
found
:=
s
.
DefaultingInterface
(
reflect
.
TypeOf
(
*
in
));
found
{
defaulting
.
(
func
(
*
extensions
.
ScaleStatus
))(
in
)
defaulting
.
(
func
(
*
extensions
.
ScaleStatus
))(
in
)
...
@@ -371,7 +358,7 @@ func Convert_extensions_JobSpec_To_v1beta1_JobSpec(in *extensions.JobSpec, out *
...
@@ -371,7 +358,7 @@ func Convert_extensions_JobSpec_To_v1beta1_JobSpec(in *extensions.JobSpec, out *
}
}
// END non-standard conversion
// 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
err
}
}
return
nil
return
nil
...
@@ -423,7 +410,7 @@ func Convert_v1beta1_JobSpec_To_extensions_JobSpec(in *JobSpec, out *extensions.
...
@@ -423,7 +410,7 @@ func Convert_v1beta1_JobSpec_To_extensions_JobSpec(in *JobSpec, out *extensions.
}
}
// END non-standard conversion
// 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
err
}
}
return
nil
return
nil
...
...
pkg/apis/extensions/v1beta1/conversion_generated.go
View file @
7448cc04
// +build !ignore_autogenerated
/*
/*
Copyright 2015 The Kubernetes Authors All rights reserved.
Copyright 2015 The Kubernetes Authors All rights reserved.
...
...
pkg/apis/extensions/v1beta1/doc.go
0 → 100644
View file @
7448cc04
/*
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
pkg/apis/metrics/v1alpha1/conversion_generated.go
View file @
7448cc04
// +build !ignore_autogenerated
/*
/*
Copyright 2015 The Kubernetes Authors All rights reserved.
Copyright 2015 The Kubernetes Authors All rights reserved.
...
...
pkg/apis/metrics/v1alpha1/doc.go
0 → 100644
View file @
7448cc04
/*
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment