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
2779de53
Commit
2779de53
authored
Nov 13, 2017
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update generated code
parent
c0707fc2
Hide whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
2055 additions
and
26 deletions
+2055
-26
zz_generated.conversion.go
...les/apiserver/apis/example2/v1/zz_generated.conversion.go
+113
-0
zz_generated.deepcopy.go
...mples/apiserver/apis/example2/v1/zz_generated.deepcopy.go
+103
-0
zz_generated.defaults.go
...mples/apiserver/apis/example2/v1/zz_generated.defaults.go
+32
-0
zz_generated.deepcopy.go
...examples/apiserver/apis/example2/zz_generated.deepcopy.go
+103
-0
clientset.go
...examples/apiserver/clientset/internalversion/clientset.go
+15
-1
clientset_generated.go
...ver/clientset/internalversion/fake/clientset_generated.go
+7
-0
register.go
...ples/apiserver/clientset/internalversion/fake/register.go
+2
-0
register.go
...es/apiserver/clientset/internalversion/scheme/register.go
+2
-0
doc.go
...set/internalversion/typed/example2/internalversion/doc.go
+18
-0
example2_client.go
...version/typed/example2/internalversion/example2_client.go
+99
-0
doc.go
...nternalversion/typed/example2/internalversion/fake/doc.go
+18
-0
fake_example2_client.go
...ped/example2/internalversion/fake/fake_example2_client.go
+38
-0
fake_testtype.go
...sion/typed/example2/internalversion/fake/fake_testtype.go
+138
-0
generated_expansion.go
...ion/typed/example2/internalversion/generated_expansion.go
+19
-0
testtype.go
...nternalversion/typed/example2/internalversion/testtype.go
+172
-0
clientset.go
...ator/_examples/apiserver/clientset/versioned/clientset.go
+23
-1
clientset_generated.go
...apiserver/clientset/versioned/fake/clientset_generated.go
+12
-0
register.go
.../_examples/apiserver/clientset/versioned/fake/register.go
+2
-0
register.go
...examples/apiserver/clientset/versioned/scheme/register.go
+2
-0
doc.go
...es/apiserver/clientset/versioned/typed/example2/v1/doc.go
+18
-0
example2_client.go
.../clientset/versioned/typed/example2/v1/example2_client.go
+88
-0
doc.go
...iserver/clientset/versioned/typed/example2/v1/fake/doc.go
+18
-0
fake_example2_client.go
.../versioned/typed/example2/v1/fake/fake_example2_client.go
+38
-0
fake_testtype.go
...ientset/versioned/typed/example2/v1/fake/fake_testtype.go
+138
-0
generated_expansion.go
...entset/versioned/typed/example2/v1/generated_expansion.go
+19
-0
testtype.go
...iserver/clientset/versioned/typed/example2/v1/testtype.go
+172
-0
interface.go
...piserver/informers/externalversions/example2/interface.go
+46
-0
interface.go
...erver/informers/externalversions/example2/v1/interface.go
+45
-0
testtype.go
...server/informers/externalversions/example2/v1/testtype.go
+88
-0
factory.go
..._examples/apiserver/informers/externalversions/factory.go
+6
-0
generic.go
..._examples/apiserver/informers/externalversions/generic.go
+5
-0
interface.go
...apiserver/informers/internalversion/example2/interface.go
+46
-0
interface.go
...ers/internalversion/example2/internalversion/interface.go
+45
-0
testtype.go
...mers/internalversion/example2/internalversion/testtype.go
+88
-0
factory.go
.../_examples/apiserver/informers/internalversion/factory.go
+6
-0
generic.go
.../_examples/apiserver/informers/internalversion/generic.go
+5
-0
expansion_generated.go
...r/listers/example2/internalversion/expansion_generated.go
+27
-0
testtype.go
...es/apiserver/listers/example2/internalversion/testtype.go
+94
-0
expansion_generated.go
...ples/apiserver/listers/example2/v1/expansion_generated.go
+27
-0
testtype.go
...rator/_examples/apiserver/listers/example2/v1/testtype.go
+94
-0
clientset.go
...-generator/_examples/crd/clientset/versioned/clientset.go
+9
-9
clientset_generated.go
...mples/crd/clientset/versioned/fake/clientset_generated.go
+6
-6
register.go
...erator/_examples/crd/clientset/versioned/fake/register.go
+2
-2
register.go
...ator/_examples/crd/clientset/versioned/scheme/register.go
+2
-2
example2_client.go
.../clientset/versioned/typed/example2/v1/example2_client.go
+1
-1
fake_testtype.go
...ientset/versioned/typed/example2/v1/fake/fake_testtype.go
+2
-2
interface.go
...ples/crd/informers/externalversions/example2/interface.go
+1
-1
generic.go
...rator/_examples/crd/informers/externalversions/generic.go
+1
-1
No files found.
staging/src/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.conversion.go
0 → 100644
View file @
2779de53
// +build !ignore_autogenerated
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
// This file was autogenerated by conversion-gen. Do not edit it manually!
package
v1
import
(
conversion
"k8s.io/apimachinery/pkg/conversion"
runtime
"k8s.io/apimachinery/pkg/runtime"
example2
"k8s.io/code-generator/_examples/apiserver/apis/example2"
unsafe
"unsafe"
)
func
init
()
{
localSchemeBuilder
.
Register
(
RegisterConversions
)
}
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func
RegisterConversions
(
scheme
*
runtime
.
Scheme
)
error
{
return
scheme
.
AddGeneratedConversionFuncs
(
Convert_v1_TestType_To_example2_TestType
,
Convert_example2_TestType_To_v1_TestType
,
Convert_v1_TestTypeList_To_example2_TestTypeList
,
Convert_example2_TestTypeList_To_v1_TestTypeList
,
Convert_v1_TestTypeStatus_To_example2_TestTypeStatus
,
Convert_example2_TestTypeStatus_To_v1_TestTypeStatus
,
)
}
func
autoConvert_v1_TestType_To_example2_TestType
(
in
*
TestType
,
out
*
example2
.
TestType
,
s
conversion
.
Scope
)
error
{
out
.
ObjectMeta
=
in
.
ObjectMeta
if
err
:=
Convert_v1_TestTypeStatus_To_example2_TestTypeStatus
(
&
in
.
Status
,
&
out
.
Status
,
s
);
err
!=
nil
{
return
err
}
return
nil
}
// Convert_v1_TestType_To_example2_TestType is an autogenerated conversion function.
func
Convert_v1_TestType_To_example2_TestType
(
in
*
TestType
,
out
*
example2
.
TestType
,
s
conversion
.
Scope
)
error
{
return
autoConvert_v1_TestType_To_example2_TestType
(
in
,
out
,
s
)
}
func
autoConvert_example2_TestType_To_v1_TestType
(
in
*
example2
.
TestType
,
out
*
TestType
,
s
conversion
.
Scope
)
error
{
out
.
ObjectMeta
=
in
.
ObjectMeta
if
err
:=
Convert_example2_TestTypeStatus_To_v1_TestTypeStatus
(
&
in
.
Status
,
&
out
.
Status
,
s
);
err
!=
nil
{
return
err
}
return
nil
}
// Convert_example2_TestType_To_v1_TestType is an autogenerated conversion function.
func
Convert_example2_TestType_To_v1_TestType
(
in
*
example2
.
TestType
,
out
*
TestType
,
s
conversion
.
Scope
)
error
{
return
autoConvert_example2_TestType_To_v1_TestType
(
in
,
out
,
s
)
}
func
autoConvert_v1_TestTypeList_To_example2_TestTypeList
(
in
*
TestTypeList
,
out
*
example2
.
TestTypeList
,
s
conversion
.
Scope
)
error
{
out
.
ListMeta
=
in
.
ListMeta
out
.
Items
=
*
(
*
[]
example2
.
TestType
)(
unsafe
.
Pointer
(
&
in
.
Items
))
return
nil
}
// Convert_v1_TestTypeList_To_example2_TestTypeList is an autogenerated conversion function.
func
Convert_v1_TestTypeList_To_example2_TestTypeList
(
in
*
TestTypeList
,
out
*
example2
.
TestTypeList
,
s
conversion
.
Scope
)
error
{
return
autoConvert_v1_TestTypeList_To_example2_TestTypeList
(
in
,
out
,
s
)
}
func
autoConvert_example2_TestTypeList_To_v1_TestTypeList
(
in
*
example2
.
TestTypeList
,
out
*
TestTypeList
,
s
conversion
.
Scope
)
error
{
out
.
ListMeta
=
in
.
ListMeta
out
.
Items
=
*
(
*
[]
TestType
)(
unsafe
.
Pointer
(
&
in
.
Items
))
return
nil
}
// Convert_example2_TestTypeList_To_v1_TestTypeList is an autogenerated conversion function.
func
Convert_example2_TestTypeList_To_v1_TestTypeList
(
in
*
example2
.
TestTypeList
,
out
*
TestTypeList
,
s
conversion
.
Scope
)
error
{
return
autoConvert_example2_TestTypeList_To_v1_TestTypeList
(
in
,
out
,
s
)
}
func
autoConvert_v1_TestTypeStatus_To_example2_TestTypeStatus
(
in
*
TestTypeStatus
,
out
*
example2
.
TestTypeStatus
,
s
conversion
.
Scope
)
error
{
out
.
Blah
=
in
.
Blah
return
nil
}
// Convert_v1_TestTypeStatus_To_example2_TestTypeStatus is an autogenerated conversion function.
func
Convert_v1_TestTypeStatus_To_example2_TestTypeStatus
(
in
*
TestTypeStatus
,
out
*
example2
.
TestTypeStatus
,
s
conversion
.
Scope
)
error
{
return
autoConvert_v1_TestTypeStatus_To_example2_TestTypeStatus
(
in
,
out
,
s
)
}
func
autoConvert_example2_TestTypeStatus_To_v1_TestTypeStatus
(
in
*
example2
.
TestTypeStatus
,
out
*
TestTypeStatus
,
s
conversion
.
Scope
)
error
{
out
.
Blah
=
in
.
Blah
return
nil
}
// Convert_example2_TestTypeStatus_To_v1_TestTypeStatus is an autogenerated conversion function.
func
Convert_example2_TestTypeStatus_To_v1_TestTypeStatus
(
in
*
example2
.
TestTypeStatus
,
out
*
TestTypeStatus
,
s
conversion
.
Scope
)
error
{
return
autoConvert_example2_TestTypeStatus_To_v1_TestTypeStatus
(
in
,
out
,
s
)
}
staging/src/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.deepcopy.go
0 → 100644
View file @
2779de53
// +build !ignore_autogenerated
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
package
v1
import
(
runtime
"k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func
(
in
*
TestType
)
DeepCopyInto
(
out
*
TestType
)
{
*
out
=
*
in
out
.
TypeMeta
=
in
.
TypeMeta
in
.
ObjectMeta
.
DeepCopyInto
(
&
out
.
ObjectMeta
)
out
.
Status
=
in
.
Status
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestType.
func
(
in
*
TestType
)
DeepCopy
()
*
TestType
{
if
in
==
nil
{
return
nil
}
out
:=
new
(
TestType
)
in
.
DeepCopyInto
(
out
)
return
out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func
(
in
*
TestType
)
DeepCopyObject
()
runtime
.
Object
{
if
c
:=
in
.
DeepCopy
();
c
!=
nil
{
return
c
}
else
{
return
nil
}
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func
(
in
*
TestTypeList
)
DeepCopyInto
(
out
*
TestTypeList
)
{
*
out
=
*
in
out
.
TypeMeta
=
in
.
TypeMeta
out
.
ListMeta
=
in
.
ListMeta
if
in
.
Items
!=
nil
{
in
,
out
:=
&
in
.
Items
,
&
out
.
Items
*
out
=
make
([]
TestType
,
len
(
*
in
))
for
i
:=
range
*
in
{
(
*
in
)[
i
]
.
DeepCopyInto
(
&
(
*
out
)[
i
])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeList.
func
(
in
*
TestTypeList
)
DeepCopy
()
*
TestTypeList
{
if
in
==
nil
{
return
nil
}
out
:=
new
(
TestTypeList
)
in
.
DeepCopyInto
(
out
)
return
out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func
(
in
*
TestTypeList
)
DeepCopyObject
()
runtime
.
Object
{
if
c
:=
in
.
DeepCopy
();
c
!=
nil
{
return
c
}
else
{
return
nil
}
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func
(
in
*
TestTypeStatus
)
DeepCopyInto
(
out
*
TestTypeStatus
)
{
*
out
=
*
in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeStatus.
func
(
in
*
TestTypeStatus
)
DeepCopy
()
*
TestTypeStatus
{
if
in
==
nil
{
return
nil
}
out
:=
new
(
TestTypeStatus
)
in
.
DeepCopyInto
(
out
)
return
out
}
staging/src/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.defaults.go
0 → 100644
View file @
2779de53
// +build !ignore_autogenerated
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
// This file was autogenerated by defaulter-gen. Do not edit it manually!
package
v1
import
(
runtime
"k8s.io/apimachinery/pkg/runtime"
)
// RegisterDefaults adds defaulters functions to the given scheme.
// Public to allow building arbitrary schemes.
// All generated defaulters are covering - they call all nested defaulters.
func
RegisterDefaults
(
scheme
*
runtime
.
Scheme
)
error
{
return
nil
}
staging/src/k8s.io/code-generator/_examples/apiserver/apis/example2/zz_generated.deepcopy.go
0 → 100644
View file @
2779de53
// +build !ignore_autogenerated
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
package
example2
import
(
runtime
"k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func
(
in
*
TestType
)
DeepCopyInto
(
out
*
TestType
)
{
*
out
=
*
in
out
.
TypeMeta
=
in
.
TypeMeta
in
.
ObjectMeta
.
DeepCopyInto
(
&
out
.
ObjectMeta
)
out
.
Status
=
in
.
Status
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestType.
func
(
in
*
TestType
)
DeepCopy
()
*
TestType
{
if
in
==
nil
{
return
nil
}
out
:=
new
(
TestType
)
in
.
DeepCopyInto
(
out
)
return
out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func
(
in
*
TestType
)
DeepCopyObject
()
runtime
.
Object
{
if
c
:=
in
.
DeepCopy
();
c
!=
nil
{
return
c
}
else
{
return
nil
}
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func
(
in
*
TestTypeList
)
DeepCopyInto
(
out
*
TestTypeList
)
{
*
out
=
*
in
out
.
TypeMeta
=
in
.
TypeMeta
out
.
ListMeta
=
in
.
ListMeta
if
in
.
Items
!=
nil
{
in
,
out
:=
&
in
.
Items
,
&
out
.
Items
*
out
=
make
([]
TestType
,
len
(
*
in
))
for
i
:=
range
*
in
{
(
*
in
)[
i
]
.
DeepCopyInto
(
&
(
*
out
)[
i
])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeList.
func
(
in
*
TestTypeList
)
DeepCopy
()
*
TestTypeList
{
if
in
==
nil
{
return
nil
}
out
:=
new
(
TestTypeList
)
in
.
DeepCopyInto
(
out
)
return
out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func
(
in
*
TestTypeList
)
DeepCopyObject
()
runtime
.
Object
{
if
c
:=
in
.
DeepCopy
();
c
!=
nil
{
return
c
}
else
{
return
nil
}
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func
(
in
*
TestTypeStatus
)
DeepCopyInto
(
out
*
TestTypeStatus
)
{
*
out
=
*
in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeStatus.
func
(
in
*
TestTypeStatus
)
DeepCopy
()
*
TestTypeStatus
{
if
in
==
nil
{
return
nil
}
out
:=
new
(
TestTypeStatus
)
in
.
DeepCopyInto
(
out
)
return
out
}
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/clientset.go
View file @
2779de53
...
@@ -22,18 +22,21 @@ import (
...
@@ -22,18 +22,21 @@ import (
rest
"k8s.io/client-go/rest"
rest
"k8s.io/client-go/rest"
flowcontrol
"k8s.io/client-go/util/flowcontrol"
flowcontrol
"k8s.io/client-go/util/flowcontrol"
exampleinternalversion
"k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion"
exampleinternalversion
"k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion"
secondexampleinternalversion
"k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion"
)
)
type
Interface
interface
{
type
Interface
interface
{
Discovery
()
discovery
.
DiscoveryInterface
Discovery
()
discovery
.
DiscoveryInterface
Example
()
exampleinternalversion
.
ExampleInterface
Example
()
exampleinternalversion
.
ExampleInterface
SecondExample
()
secondexampleinternalversion
.
SecondExampleInterface
}
}
// Clientset contains the clients for groups. Each group has exactly one
// Clientset contains the clients for groups. Each group has exactly one
// version included in a Clientset.
// version included in a Clientset.
type
Clientset
struct
{
type
Clientset
struct
{
*
discovery
.
DiscoveryClient
*
discovery
.
DiscoveryClient
example
*
exampleinternalversion
.
ExampleClient
example
*
exampleinternalversion
.
ExampleClient
secondExample
*
secondexampleinternalversion
.
SecondExampleClient
}
}
// Example retrieves the ExampleClient
// Example retrieves the ExampleClient
...
@@ -41,6 +44,11 @@ func (c *Clientset) Example() exampleinternalversion.ExampleInterface {
...
@@ -41,6 +44,11 @@ func (c *Clientset) Example() exampleinternalversion.ExampleInterface {
return
c
.
example
return
c
.
example
}
}
// SecondExample retrieves the SecondExampleClient
func
(
c
*
Clientset
)
SecondExample
()
secondexampleinternalversion
.
SecondExampleInterface
{
return
c
.
secondExample
}
// Discovery retrieves the DiscoveryClient
// Discovery retrieves the DiscoveryClient
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
if
c
==
nil
{
if
c
==
nil
{
...
@@ -61,6 +69,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
...
@@ -61,6 +69,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
cs
.
secondExample
,
err
=
secondexampleinternalversion
.
NewForConfig
(
&
configShallowCopy
)
if
err
!=
nil
{
return
nil
,
err
}
cs
.
DiscoveryClient
,
err
=
discovery
.
NewDiscoveryClientForConfig
(
&
configShallowCopy
)
cs
.
DiscoveryClient
,
err
=
discovery
.
NewDiscoveryClientForConfig
(
&
configShallowCopy
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -75,6 +87,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
...
@@ -75,6 +87,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
func
NewForConfigOrDie
(
c
*
rest
.
Config
)
*
Clientset
{
func
NewForConfigOrDie
(
c
*
rest
.
Config
)
*
Clientset
{
var
cs
Clientset
var
cs
Clientset
cs
.
example
=
exampleinternalversion
.
NewForConfigOrDie
(
c
)
cs
.
example
=
exampleinternalversion
.
NewForConfigOrDie
(
c
)
cs
.
secondExample
=
secondexampleinternalversion
.
NewForConfigOrDie
(
c
)
cs
.
DiscoveryClient
=
discovery
.
NewDiscoveryClientForConfigOrDie
(
c
)
cs
.
DiscoveryClient
=
discovery
.
NewDiscoveryClientForConfigOrDie
(
c
)
return
&
cs
return
&
cs
...
@@ -84,6 +97,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
...
@@ -84,6 +97,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
func
New
(
c
rest
.
Interface
)
*
Clientset
{
func
New
(
c
rest
.
Interface
)
*
Clientset
{
var
cs
Clientset
var
cs
Clientset
cs
.
example
=
exampleinternalversion
.
New
(
c
)
cs
.
example
=
exampleinternalversion
.
New
(
c
)
cs
.
secondExample
=
secondexampleinternalversion
.
New
(
c
)
cs
.
DiscoveryClient
=
discovery
.
NewDiscoveryClient
(
c
)
cs
.
DiscoveryClient
=
discovery
.
NewDiscoveryClient
(
c
)
return
&
cs
return
&
cs
...
...
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/fake/clientset_generated.go
View file @
2779de53
...
@@ -25,6 +25,8 @@ import (
...
@@ -25,6 +25,8 @@ import (
clientset
"k8s.io/code-generator/_examples/apiserver/clientset/internalversion"
clientset
"k8s.io/code-generator/_examples/apiserver/clientset/internalversion"
exampleinternalversion
"k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion"
exampleinternalversion
"k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion"
fakeexampleinternalversion
"k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake"
fakeexampleinternalversion
"k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake"
secondexampleinternalversion
"k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion"
fakesecondexampleinternalversion
"k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake"
)
)
// NewSimpleClientset returns a clientset that will respond with the provided objects.
// NewSimpleClientset returns a clientset that will respond with the provided objects.
...
@@ -64,3 +66,8 @@ var _ clientset.Interface = &Clientset{}
...
@@ -64,3 +66,8 @@ var _ clientset.Interface = &Clientset{}
func
(
c
*
Clientset
)
Example
()
exampleinternalversion
.
ExampleInterface
{
func
(
c
*
Clientset
)
Example
()
exampleinternalversion
.
ExampleInterface
{
return
&
fakeexampleinternalversion
.
FakeExample
{
Fake
:
&
c
.
Fake
}
return
&
fakeexampleinternalversion
.
FakeExample
{
Fake
:
&
c
.
Fake
}
}
}
// SecondExample retrieves the SecondExampleClient
func
(
c
*
Clientset
)
SecondExample
()
secondexampleinternalversion
.
SecondExampleInterface
{
return
&
fakesecondexampleinternalversion
.
FakeSecondExample
{
Fake
:
&
c
.
Fake
}
}
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/fake/register.go
View file @
2779de53
...
@@ -22,6 +22,7 @@ import (
...
@@ -22,6 +22,7 @@ import (
schema
"k8s.io/apimachinery/pkg/runtime/schema"
schema
"k8s.io/apimachinery/pkg/runtime/schema"
serializer
"k8s.io/apimachinery/pkg/runtime/serializer"
serializer
"k8s.io/apimachinery/pkg/runtime/serializer"
exampleinternalversion
"k8s.io/code-generator/_examples/apiserver/apis/example"
exampleinternalversion
"k8s.io/code-generator/_examples/apiserver/apis/example"
secondexampleinternalversion
"k8s.io/code-generator/_examples/apiserver/apis/example2"
)
)
var
scheme
=
runtime
.
NewScheme
()
var
scheme
=
runtime
.
NewScheme
()
...
@@ -49,5 +50,6 @@ func init() {
...
@@ -49,5 +50,6 @@ func init() {
// correctly.
// correctly.
func
AddToScheme
(
scheme
*
runtime
.
Scheme
)
{
func
AddToScheme
(
scheme
*
runtime
.
Scheme
)
{
exampleinternalversion
.
AddToScheme
(
scheme
)
exampleinternalversion
.
AddToScheme
(
scheme
)
secondexampleinternalversion
.
AddToScheme
(
scheme
)
}
}
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/scheme/register.go
View file @
2779de53
...
@@ -24,6 +24,7 @@ import (
...
@@ -24,6 +24,7 @@ import (
schema
"k8s.io/apimachinery/pkg/runtime/schema"
schema
"k8s.io/apimachinery/pkg/runtime/schema"
serializer
"k8s.io/apimachinery/pkg/runtime/serializer"
serializer
"k8s.io/apimachinery/pkg/runtime/serializer"
example
"k8s.io/code-generator/_examples/apiserver/apis/example/install"
example
"k8s.io/code-generator/_examples/apiserver/apis/example/install"
secondexample
"k8s.io/code-generator/_examples/apiserver/apis/example2/install"
os
"os"
os
"os"
)
)
...
@@ -42,5 +43,6 @@ func init() {
...
@@ -42,5 +43,6 @@ func init() {
// Install registers the API group and adds types to a scheme
// Install registers the API group and adds types to a scheme
func
Install
(
groupFactoryRegistry
announced
.
APIGroupFactoryRegistry
,
registry
*
registered
.
APIRegistrationManager
,
scheme
*
runtime
.
Scheme
)
{
func
Install
(
groupFactoryRegistry
announced
.
APIGroupFactoryRegistry
,
registry
*
registered
.
APIRegistrationManager
,
scheme
*
runtime
.
Scheme
)
{
example
.
Install
(
groupFactoryRegistry
,
registry
,
scheme
)
example
.
Install
(
groupFactoryRegistry
,
registry
,
scheme
)
secondexample
.
Install
(
groupFactoryRegistry
,
registry
,
scheme
)
}
}
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/doc.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
// This package has the automatically generated typed clients.
package
internalversion
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/example2_client.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
package
internalversion
import
(
rest
"k8s.io/client-go/rest"
"k8s.io/code-generator/_examples/apiserver/clientset/internalversion/scheme"
)
type
SecondExampleInterface
interface
{
RESTClient
()
rest
.
Interface
TestTypesGetter
}
// SecondExampleClient is used to interact with features provided by the example.test.apiserver.code-generator.k8s.io group.
type
SecondExampleClient
struct
{
restClient
rest
.
Interface
}
func
(
c
*
SecondExampleClient
)
TestTypes
(
namespace
string
)
TestTypeInterface
{
return
newTestTypes
(
c
,
namespace
)
}
// NewForConfig creates a new SecondExampleClient for the given config.
func
NewForConfig
(
c
*
rest
.
Config
)
(
*
SecondExampleClient
,
error
)
{
config
:=
*
c
if
err
:=
setConfigDefaults
(
&
config
);
err
!=
nil
{
return
nil
,
err
}
client
,
err
:=
rest
.
RESTClientFor
(
&
config
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
SecondExampleClient
{
client
},
nil
}
// NewForConfigOrDie creates a new SecondExampleClient for the given config and
// panics if there is an error in the config.
func
NewForConfigOrDie
(
c
*
rest
.
Config
)
*
SecondExampleClient
{
client
,
err
:=
NewForConfig
(
c
)
if
err
!=
nil
{
panic
(
err
)
}
return
client
}
// New creates a new SecondExampleClient for the given RESTClient.
func
New
(
c
rest
.
Interface
)
*
SecondExampleClient
{
return
&
SecondExampleClient
{
c
}
}
func
setConfigDefaults
(
config
*
rest
.
Config
)
error
{
g
,
err
:=
scheme
.
Registry
.
Group
(
"example.test.apiserver.code-generator.k8s.io"
)
if
err
!=
nil
{
return
err
}
config
.
APIPath
=
"/apis"
if
config
.
UserAgent
==
""
{
config
.
UserAgent
=
rest
.
DefaultKubernetesUserAgent
()
}
if
config
.
GroupVersion
==
nil
||
config
.
GroupVersion
.
Group
!=
g
.
GroupVersion
.
Group
{
gv
:=
g
.
GroupVersion
config
.
GroupVersion
=
&
gv
}
config
.
NegotiatedSerializer
=
scheme
.
Codecs
if
config
.
QPS
==
0
{
config
.
QPS
=
5
}
if
config
.
Burst
==
0
{
config
.
Burst
=
10
}
return
nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func
(
c
*
SecondExampleClient
)
RESTClient
()
rest
.
Interface
{
if
c
==
nil
{
return
nil
}
return
c
.
restClient
}
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/doc.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
// Package fake has the automatically generated clients.
package
fake
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_example2_client.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
package
fake
import
(
rest
"k8s.io/client-go/rest"
testing
"k8s.io/client-go/testing"
internalversion
"k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion"
)
type
FakeSecondExample
struct
{
*
testing
.
Fake
}
func
(
c
*
FakeSecondExample
)
TestTypes
(
namespace
string
)
internalversion
.
TestTypeInterface
{
return
&
FakeTestTypes
{
c
,
namespace
}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func
(
c
*
FakeSecondExample
)
RESTClient
()
rest
.
Interface
{
var
ret
*
rest
.
RESTClient
return
ret
}
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_testtype.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
package
fake
import
(
v1
"k8s.io/apimachinery/pkg/apis/meta/v1"
labels
"k8s.io/apimachinery/pkg/labels"
schema
"k8s.io/apimachinery/pkg/runtime/schema"
types
"k8s.io/apimachinery/pkg/types"
watch
"k8s.io/apimachinery/pkg/watch"
testing
"k8s.io/client-go/testing"
example2
"k8s.io/code-generator/_examples/apiserver/apis/example2"
)
// FakeTestTypes implements TestTypeInterface
type
FakeTestTypes
struct
{
Fake
*
FakeSecondExample
ns
string
}
var
testtypesResource
=
schema
.
GroupVersionResource
{
Group
:
"example.test.apiserver.code-generator.k8s.io"
,
Version
:
""
,
Resource
:
"testtypes"
}
var
testtypesKind
=
schema
.
GroupVersionKind
{
Group
:
"example.test.apiserver.code-generator.k8s.io"
,
Version
:
""
,
Kind
:
"TestType"
}
// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any.
func
(
c
*
FakeTestTypes
)
Get
(
name
string
,
options
v1
.
GetOptions
)
(
result
*
example2
.
TestType
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewGetAction
(
testtypesResource
,
c
.
ns
,
name
),
&
example2
.
TestType
{})
if
obj
==
nil
{
return
nil
,
err
}
return
obj
.
(
*
example2
.
TestType
),
err
}
// List takes label and field selectors, and returns the list of TestTypes that match those selectors.
func
(
c
*
FakeTestTypes
)
List
(
opts
v1
.
ListOptions
)
(
result
*
example2
.
TestTypeList
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewListAction
(
testtypesResource
,
testtypesKind
,
c
.
ns
,
opts
),
&
example2
.
TestTypeList
{})
if
obj
==
nil
{
return
nil
,
err
}
label
,
_
,
_
:=
testing
.
ExtractFromListOptions
(
opts
)
if
label
==
nil
{
label
=
labels
.
Everything
()
}
list
:=
&
example2
.
TestTypeList
{}
for
_
,
item
:=
range
obj
.
(
*
example2
.
TestTypeList
)
.
Items
{
if
label
.
Matches
(
labels
.
Set
(
item
.
Labels
))
{
list
.
Items
=
append
(
list
.
Items
,
item
)
}
}
return
list
,
err
}
// Watch returns a watch.Interface that watches the requested testTypes.
func
(
c
*
FakeTestTypes
)
Watch
(
opts
v1
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
Fake
.
InvokesWatch
(
testing
.
NewWatchAction
(
testtypesResource
,
c
.
ns
,
opts
))
}
// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any.
func
(
c
*
FakeTestTypes
)
Create
(
testType
*
example2
.
TestType
)
(
result
*
example2
.
TestType
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewCreateAction
(
testtypesResource
,
c
.
ns
,
testType
),
&
example2
.
TestType
{})
if
obj
==
nil
{
return
nil
,
err
}
return
obj
.
(
*
example2
.
TestType
),
err
}
// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any.
func
(
c
*
FakeTestTypes
)
Update
(
testType
*
example2
.
TestType
)
(
result
*
example2
.
TestType
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewUpdateAction
(
testtypesResource
,
c
.
ns
,
testType
),
&
example2
.
TestType
{})
if
obj
==
nil
{
return
nil
,
err
}
return
obj
.
(
*
example2
.
TestType
),
err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func
(
c
*
FakeTestTypes
)
UpdateStatus
(
testType
*
example2
.
TestType
)
(
*
example2
.
TestType
,
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewUpdateSubresourceAction
(
testtypesResource
,
"status"
,
c
.
ns
,
testType
),
&
example2
.
TestType
{})
if
obj
==
nil
{
return
nil
,
err
}
return
obj
.
(
*
example2
.
TestType
),
err
}
// Delete takes name of the testType and deletes it. Returns an error if one occurs.
func
(
c
*
FakeTestTypes
)
Delete
(
name
string
,
options
*
v1
.
DeleteOptions
)
error
{
_
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewDeleteAction
(
testtypesResource
,
c
.
ns
,
name
),
&
example2
.
TestType
{})
return
err
}
// DeleteCollection deletes a collection of objects.
func
(
c
*
FakeTestTypes
)
DeleteCollection
(
options
*
v1
.
DeleteOptions
,
listOptions
v1
.
ListOptions
)
error
{
action
:=
testing
.
NewDeleteCollectionAction
(
testtypesResource
,
c
.
ns
,
listOptions
)
_
,
err
:=
c
.
Fake
.
Invokes
(
action
,
&
example2
.
TestTypeList
{})
return
err
}
// Patch applies the patch and returns the patched testType.
func
(
c
*
FakeTestTypes
)
Patch
(
name
string
,
pt
types
.
PatchType
,
data
[]
byte
,
subresources
...
string
)
(
result
*
example2
.
TestType
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewPatchSubresourceAction
(
testtypesResource
,
c
.
ns
,
name
,
data
,
subresources
...
),
&
example2
.
TestType
{})
if
obj
==
nil
{
return
nil
,
err
}
return
obj
.
(
*
example2
.
TestType
),
err
}
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/generated_expansion.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
package
internalversion
type
TestTypeExpansion
interface
{}
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/testtype.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
package
internalversion
import
(
v1
"k8s.io/apimachinery/pkg/apis/meta/v1"
types
"k8s.io/apimachinery/pkg/types"
watch
"k8s.io/apimachinery/pkg/watch"
rest
"k8s.io/client-go/rest"
example2
"k8s.io/code-generator/_examples/apiserver/apis/example2"
scheme
"k8s.io/code-generator/_examples/apiserver/clientset/internalversion/scheme"
)
// TestTypesGetter has a method to return a TestTypeInterface.
// A group's client should implement this interface.
type
TestTypesGetter
interface
{
TestTypes
(
namespace
string
)
TestTypeInterface
}
// TestTypeInterface has methods to work with TestType resources.
type
TestTypeInterface
interface
{
Create
(
*
example2
.
TestType
)
(
*
example2
.
TestType
,
error
)
Update
(
*
example2
.
TestType
)
(
*
example2
.
TestType
,
error
)
UpdateStatus
(
*
example2
.
TestType
)
(
*
example2
.
TestType
,
error
)
Delete
(
name
string
,
options
*
v1
.
DeleteOptions
)
error
DeleteCollection
(
options
*
v1
.
DeleteOptions
,
listOptions
v1
.
ListOptions
)
error
Get
(
name
string
,
options
v1
.
GetOptions
)
(
*
example2
.
TestType
,
error
)
List
(
opts
v1
.
ListOptions
)
(
*
example2
.
TestTypeList
,
error
)
Watch
(
opts
v1
.
ListOptions
)
(
watch
.
Interface
,
error
)
Patch
(
name
string
,
pt
types
.
PatchType
,
data
[]
byte
,
subresources
...
string
)
(
result
*
example2
.
TestType
,
err
error
)
TestTypeExpansion
}
// testTypes implements TestTypeInterface
type
testTypes
struct
{
client
rest
.
Interface
ns
string
}
// newTestTypes returns a TestTypes
func
newTestTypes
(
c
*
SecondExampleClient
,
namespace
string
)
*
testTypes
{
return
&
testTypes
{
client
:
c
.
RESTClient
(),
ns
:
namespace
,
}
}
// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any.
func
(
c
*
testTypes
)
Get
(
name
string
,
options
v1
.
GetOptions
)
(
result
*
example2
.
TestType
,
err
error
)
{
result
=
&
example2
.
TestType
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
Name
(
name
)
.
VersionedParams
(
&
options
,
scheme
.
ParameterCodec
)
.
Do
()
.
Into
(
result
)
return
}
// List takes label and field selectors, and returns the list of TestTypes that match those selectors.
func
(
c
*
testTypes
)
List
(
opts
v1
.
ListOptions
)
(
result
*
example2
.
TestTypeList
,
err
error
)
{
result
=
&
example2
.
TestTypeList
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
VersionedParams
(
&
opts
,
scheme
.
ParameterCodec
)
.
Do
()
.
Into
(
result
)
return
}
// Watch returns a watch.Interface that watches the requested testTypes.
func
(
c
*
testTypes
)
Watch
(
opts
v1
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
opts
.
Watch
=
true
return
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
VersionedParams
(
&
opts
,
scheme
.
ParameterCodec
)
.
Watch
()
}
// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any.
func
(
c
*
testTypes
)
Create
(
testType
*
example2
.
TestType
)
(
result
*
example2
.
TestType
,
err
error
)
{
result
=
&
example2
.
TestType
{}
err
=
c
.
client
.
Post
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
Body
(
testType
)
.
Do
()
.
Into
(
result
)
return
}
// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any.
func
(
c
*
testTypes
)
Update
(
testType
*
example2
.
TestType
)
(
result
*
example2
.
TestType
,
err
error
)
{
result
=
&
example2
.
TestType
{}
err
=
c
.
client
.
Put
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
Name
(
testType
.
Name
)
.
Body
(
testType
)
.
Do
()
.
Into
(
result
)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func
(
c
*
testTypes
)
UpdateStatus
(
testType
*
example2
.
TestType
)
(
result
*
example2
.
TestType
,
err
error
)
{
result
=
&
example2
.
TestType
{}
err
=
c
.
client
.
Put
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
Name
(
testType
.
Name
)
.
SubResource
(
"status"
)
.
Body
(
testType
)
.
Do
()
.
Into
(
result
)
return
}
// Delete takes name of the testType and deletes it. Returns an error if one occurs.
func
(
c
*
testTypes
)
Delete
(
name
string
,
options
*
v1
.
DeleteOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
Name
(
name
)
.
Body
(
options
)
.
Do
()
.
Error
()
}
// DeleteCollection deletes a collection of objects.
func
(
c
*
testTypes
)
DeleteCollection
(
options
*
v1
.
DeleteOptions
,
listOptions
v1
.
ListOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
VersionedParams
(
&
listOptions
,
scheme
.
ParameterCodec
)
.
Body
(
options
)
.
Do
()
.
Error
()
}
// Patch applies the patch and returns the patched testType.
func
(
c
*
testTypes
)
Patch
(
name
string
,
pt
types
.
PatchType
,
data
[]
byte
,
subresources
...
string
)
(
result
*
example2
.
TestType
,
err
error
)
{
result
=
&
example2
.
TestType
{}
err
=
c
.
client
.
Patch
(
pt
)
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
SubResource
(
subresources
...
)
.
Name
(
name
)
.
Body
(
data
)
.
Do
()
.
Into
(
result
)
return
}
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/clientset.go
View file @
2779de53
...
@@ -22,6 +22,7 @@ import (
...
@@ -22,6 +22,7 @@ import (
rest
"k8s.io/client-go/rest"
rest
"k8s.io/client-go/rest"
flowcontrol
"k8s.io/client-go/util/flowcontrol"
flowcontrol
"k8s.io/client-go/util/flowcontrol"
examplev1
"k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1"
examplev1
"k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1"
secondexamplev1
"k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1"
)
)
type
Interface
interface
{
type
Interface
interface
{
...
@@ -29,13 +30,17 @@ type Interface interface {
...
@@ -29,13 +30,17 @@ type Interface interface {
ExampleV1
()
examplev1
.
ExampleV1Interface
ExampleV1
()
examplev1
.
ExampleV1Interface
// Deprecated: please explicitly pick a version if possible.
// Deprecated: please explicitly pick a version if possible.
Example
()
examplev1
.
ExampleV1Interface
Example
()
examplev1
.
ExampleV1Interface
SecondExampleV1
()
secondexamplev1
.
SecondExampleV1Interface
// Deprecated: please explicitly pick a version if possible.
SecondExample
()
secondexamplev1
.
SecondExampleV1Interface
}
}
// Clientset contains the clients for groups. Each group has exactly one
// Clientset contains the clients for groups. Each group has exactly one
// version included in a Clientset.
// version included in a Clientset.
type
Clientset
struct
{
type
Clientset
struct
{
*
discovery
.
DiscoveryClient
*
discovery
.
DiscoveryClient
exampleV1
*
examplev1
.
ExampleV1Client
exampleV1
*
examplev1
.
ExampleV1Client
secondExampleV1
*
secondexamplev1
.
SecondExampleV1Client
}
}
// ExampleV1 retrieves the ExampleV1Client
// ExampleV1 retrieves the ExampleV1Client
...
@@ -49,6 +54,17 @@ func (c *Clientset) Example() examplev1.ExampleV1Interface {
...
@@ -49,6 +54,17 @@ func (c *Clientset) Example() examplev1.ExampleV1Interface {
return
c
.
exampleV1
return
c
.
exampleV1
}
}
// SecondExampleV1 retrieves the SecondExampleV1Client
func
(
c
*
Clientset
)
SecondExampleV1
()
secondexamplev1
.
SecondExampleV1Interface
{
return
c
.
secondExampleV1
}
// Deprecated: SecondExample retrieves the default version of SecondExampleClient.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
SecondExample
()
secondexamplev1
.
SecondExampleV1Interface
{
return
c
.
secondExampleV1
}
// Discovery retrieves the DiscoveryClient
// Discovery retrieves the DiscoveryClient
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
func
(
c
*
Clientset
)
Discovery
()
discovery
.
DiscoveryInterface
{
if
c
==
nil
{
if
c
==
nil
{
...
@@ -69,6 +85,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
...
@@ -69,6 +85,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
cs
.
secondExampleV1
,
err
=
secondexamplev1
.
NewForConfig
(
&
configShallowCopy
)
if
err
!=
nil
{
return
nil
,
err
}
cs
.
DiscoveryClient
,
err
=
discovery
.
NewDiscoveryClientForConfig
(
&
configShallowCopy
)
cs
.
DiscoveryClient
,
err
=
discovery
.
NewDiscoveryClientForConfig
(
&
configShallowCopy
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -83,6 +103,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
...
@@ -83,6 +103,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
func
NewForConfigOrDie
(
c
*
rest
.
Config
)
*
Clientset
{
func
NewForConfigOrDie
(
c
*
rest
.
Config
)
*
Clientset
{
var
cs
Clientset
var
cs
Clientset
cs
.
exampleV1
=
examplev1
.
NewForConfigOrDie
(
c
)
cs
.
exampleV1
=
examplev1
.
NewForConfigOrDie
(
c
)
cs
.
secondExampleV1
=
secondexamplev1
.
NewForConfigOrDie
(
c
)
cs
.
DiscoveryClient
=
discovery
.
NewDiscoveryClientForConfigOrDie
(
c
)
cs
.
DiscoveryClient
=
discovery
.
NewDiscoveryClientForConfigOrDie
(
c
)
return
&
cs
return
&
cs
...
@@ -92,6 +113,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
...
@@ -92,6 +113,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
func
New
(
c
rest
.
Interface
)
*
Clientset
{
func
New
(
c
rest
.
Interface
)
*
Clientset
{
var
cs
Clientset
var
cs
Clientset
cs
.
exampleV1
=
examplev1
.
New
(
c
)
cs
.
exampleV1
=
examplev1
.
New
(
c
)
cs
.
secondExampleV1
=
secondexamplev1
.
New
(
c
)
cs
.
DiscoveryClient
=
discovery
.
NewDiscoveryClient
(
c
)
cs
.
DiscoveryClient
=
discovery
.
NewDiscoveryClient
(
c
)
return
&
cs
return
&
cs
...
...
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/clientset_generated.go
View file @
2779de53
...
@@ -25,6 +25,8 @@ import (
...
@@ -25,6 +25,8 @@ import (
clientset
"k8s.io/code-generator/_examples/apiserver/clientset/versioned"
clientset
"k8s.io/code-generator/_examples/apiserver/clientset/versioned"
examplev1
"k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1"
examplev1
"k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1"
fakeexamplev1
"k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake"
fakeexamplev1
"k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake"
secondexamplev1
"k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1"
fakesecondexamplev1
"k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake"
)
)
// NewSimpleClientset returns a clientset that will respond with the provided objects.
// NewSimpleClientset returns a clientset that will respond with the provided objects.
...
@@ -69,3 +71,13 @@ func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface {
...
@@ -69,3 +71,13 @@ func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface {
func
(
c
*
Clientset
)
Example
()
examplev1
.
ExampleV1Interface
{
func
(
c
*
Clientset
)
Example
()
examplev1
.
ExampleV1Interface
{
return
&
fakeexamplev1
.
FakeExampleV1
{
Fake
:
&
c
.
Fake
}
return
&
fakeexamplev1
.
FakeExampleV1
{
Fake
:
&
c
.
Fake
}
}
}
// SecondExampleV1 retrieves the SecondExampleV1Client
func
(
c
*
Clientset
)
SecondExampleV1
()
secondexamplev1
.
SecondExampleV1Interface
{
return
&
fakesecondexamplev1
.
FakeSecondExampleV1
{
Fake
:
&
c
.
Fake
}
}
// SecondExample retrieves the SecondExampleV1Client
func
(
c
*
Clientset
)
SecondExample
()
secondexamplev1
.
SecondExampleV1Interface
{
return
&
fakesecondexamplev1
.
FakeSecondExampleV1
{
Fake
:
&
c
.
Fake
}
}
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/register.go
View file @
2779de53
...
@@ -22,6 +22,7 @@ import (
...
@@ -22,6 +22,7 @@ import (
schema
"k8s.io/apimachinery/pkg/runtime/schema"
schema
"k8s.io/apimachinery/pkg/runtime/schema"
serializer
"k8s.io/apimachinery/pkg/runtime/serializer"
serializer
"k8s.io/apimachinery/pkg/runtime/serializer"
examplev1
"k8s.io/code-generator/_examples/apiserver/apis/example/v1"
examplev1
"k8s.io/code-generator/_examples/apiserver/apis/example/v1"
secondexamplev1
"k8s.io/code-generator/_examples/apiserver/apis/example2/v1"
)
)
var
scheme
=
runtime
.
NewScheme
()
var
scheme
=
runtime
.
NewScheme
()
...
@@ -49,5 +50,6 @@ func init() {
...
@@ -49,5 +50,6 @@ func init() {
// correctly.
// correctly.
func
AddToScheme
(
scheme
*
runtime
.
Scheme
)
{
func
AddToScheme
(
scheme
*
runtime
.
Scheme
)
{
examplev1
.
AddToScheme
(
scheme
)
examplev1
.
AddToScheme
(
scheme
)
secondexamplev1
.
AddToScheme
(
scheme
)
}
}
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme/register.go
View file @
2779de53
...
@@ -22,6 +22,7 @@ import (
...
@@ -22,6 +22,7 @@ import (
schema
"k8s.io/apimachinery/pkg/runtime/schema"
schema
"k8s.io/apimachinery/pkg/runtime/schema"
serializer
"k8s.io/apimachinery/pkg/runtime/serializer"
serializer
"k8s.io/apimachinery/pkg/runtime/serializer"
examplev1
"k8s.io/code-generator/_examples/apiserver/apis/example/v1"
examplev1
"k8s.io/code-generator/_examples/apiserver/apis/example/v1"
secondexamplev1
"k8s.io/code-generator/_examples/apiserver/apis/example2/v1"
)
)
var
Scheme
=
runtime
.
NewScheme
()
var
Scheme
=
runtime
.
NewScheme
()
...
@@ -49,5 +50,6 @@ func init() {
...
@@ -49,5 +50,6 @@ func init() {
// correctly.
// correctly.
func
AddToScheme
(
scheme
*
runtime
.
Scheme
)
{
func
AddToScheme
(
scheme
*
runtime
.
Scheme
)
{
examplev1
.
AddToScheme
(
scheme
)
examplev1
.
AddToScheme
(
scheme
)
secondexamplev1
.
AddToScheme
(
scheme
)
}
}
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/doc.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
// This package has the automatically generated typed clients.
package
v1
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/example2_client.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
package
v1
import
(
serializer
"k8s.io/apimachinery/pkg/runtime/serializer"
rest
"k8s.io/client-go/rest"
v1
"k8s.io/code-generator/_examples/apiserver/apis/example2/v1"
"k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme"
)
type
SecondExampleV1Interface
interface
{
RESTClient
()
rest
.
Interface
TestTypesGetter
}
// SecondExampleV1Client is used to interact with features provided by the example.test.apiserver.code-generator.k8s.io group.
type
SecondExampleV1Client
struct
{
restClient
rest
.
Interface
}
func
(
c
*
SecondExampleV1Client
)
TestTypes
(
namespace
string
)
TestTypeInterface
{
return
newTestTypes
(
c
,
namespace
)
}
// NewForConfig creates a new SecondExampleV1Client for the given config.
func
NewForConfig
(
c
*
rest
.
Config
)
(
*
SecondExampleV1Client
,
error
)
{
config
:=
*
c
if
err
:=
setConfigDefaults
(
&
config
);
err
!=
nil
{
return
nil
,
err
}
client
,
err
:=
rest
.
RESTClientFor
(
&
config
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
SecondExampleV1Client
{
client
},
nil
}
// NewForConfigOrDie creates a new SecondExampleV1Client for the given config and
// panics if there is an error in the config.
func
NewForConfigOrDie
(
c
*
rest
.
Config
)
*
SecondExampleV1Client
{
client
,
err
:=
NewForConfig
(
c
)
if
err
!=
nil
{
panic
(
err
)
}
return
client
}
// New creates a new SecondExampleV1Client for the given RESTClient.
func
New
(
c
rest
.
Interface
)
*
SecondExampleV1Client
{
return
&
SecondExampleV1Client
{
c
}
}
func
setConfigDefaults
(
config
*
rest
.
Config
)
error
{
gv
:=
v1
.
SchemeGroupVersion
config
.
GroupVersion
=
&
gv
config
.
APIPath
=
"/apis"
config
.
NegotiatedSerializer
=
serializer
.
DirectCodecFactory
{
CodecFactory
:
scheme
.
Codecs
}
if
config
.
UserAgent
==
""
{
config
.
UserAgent
=
rest
.
DefaultKubernetesUserAgent
()
}
return
nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func
(
c
*
SecondExampleV1Client
)
RESTClient
()
rest
.
Interface
{
if
c
==
nil
{
return
nil
}
return
c
.
restClient
}
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/doc.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
// Package fake has the automatically generated clients.
package
fake
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_example2_client.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
package
fake
import
(
rest
"k8s.io/client-go/rest"
testing
"k8s.io/client-go/testing"
v1
"k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1"
)
type
FakeSecondExampleV1
struct
{
*
testing
.
Fake
}
func
(
c
*
FakeSecondExampleV1
)
TestTypes
(
namespace
string
)
v1
.
TestTypeInterface
{
return
&
FakeTestTypes
{
c
,
namespace
}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func
(
c
*
FakeSecondExampleV1
)
RESTClient
()
rest
.
Interface
{
var
ret
*
rest
.
RESTClient
return
ret
}
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_testtype.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
package
fake
import
(
v1
"k8s.io/apimachinery/pkg/apis/meta/v1"
labels
"k8s.io/apimachinery/pkg/labels"
schema
"k8s.io/apimachinery/pkg/runtime/schema"
types
"k8s.io/apimachinery/pkg/types"
watch
"k8s.io/apimachinery/pkg/watch"
testing
"k8s.io/client-go/testing"
example2_v1
"k8s.io/code-generator/_examples/apiserver/apis/example2/v1"
)
// FakeTestTypes implements TestTypeInterface
type
FakeTestTypes
struct
{
Fake
*
FakeSecondExampleV1
ns
string
}
var
testtypesResource
=
schema
.
GroupVersionResource
{
Group
:
"example.test.apiserver.code-generator.k8s.io"
,
Version
:
"v1"
,
Resource
:
"testtypes"
}
var
testtypesKind
=
schema
.
GroupVersionKind
{
Group
:
"example.test.apiserver.code-generator.k8s.io"
,
Version
:
"v1"
,
Kind
:
"TestType"
}
// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any.
func
(
c
*
FakeTestTypes
)
Get
(
name
string
,
options
v1
.
GetOptions
)
(
result
*
example2_v1
.
TestType
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewGetAction
(
testtypesResource
,
c
.
ns
,
name
),
&
example2_v1
.
TestType
{})
if
obj
==
nil
{
return
nil
,
err
}
return
obj
.
(
*
example2_v1
.
TestType
),
err
}
// List takes label and field selectors, and returns the list of TestTypes that match those selectors.
func
(
c
*
FakeTestTypes
)
List
(
opts
v1
.
ListOptions
)
(
result
*
example2_v1
.
TestTypeList
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewListAction
(
testtypesResource
,
testtypesKind
,
c
.
ns
,
opts
),
&
example2_v1
.
TestTypeList
{})
if
obj
==
nil
{
return
nil
,
err
}
label
,
_
,
_
:=
testing
.
ExtractFromListOptions
(
opts
)
if
label
==
nil
{
label
=
labels
.
Everything
()
}
list
:=
&
example2_v1
.
TestTypeList
{}
for
_
,
item
:=
range
obj
.
(
*
example2_v1
.
TestTypeList
)
.
Items
{
if
label
.
Matches
(
labels
.
Set
(
item
.
Labels
))
{
list
.
Items
=
append
(
list
.
Items
,
item
)
}
}
return
list
,
err
}
// Watch returns a watch.Interface that watches the requested testTypes.
func
(
c
*
FakeTestTypes
)
Watch
(
opts
v1
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
Fake
.
InvokesWatch
(
testing
.
NewWatchAction
(
testtypesResource
,
c
.
ns
,
opts
))
}
// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any.
func
(
c
*
FakeTestTypes
)
Create
(
testType
*
example2_v1
.
TestType
)
(
result
*
example2_v1
.
TestType
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewCreateAction
(
testtypesResource
,
c
.
ns
,
testType
),
&
example2_v1
.
TestType
{})
if
obj
==
nil
{
return
nil
,
err
}
return
obj
.
(
*
example2_v1
.
TestType
),
err
}
// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any.
func
(
c
*
FakeTestTypes
)
Update
(
testType
*
example2_v1
.
TestType
)
(
result
*
example2_v1
.
TestType
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewUpdateAction
(
testtypesResource
,
c
.
ns
,
testType
),
&
example2_v1
.
TestType
{})
if
obj
==
nil
{
return
nil
,
err
}
return
obj
.
(
*
example2_v1
.
TestType
),
err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func
(
c
*
FakeTestTypes
)
UpdateStatus
(
testType
*
example2_v1
.
TestType
)
(
*
example2_v1
.
TestType
,
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewUpdateSubresourceAction
(
testtypesResource
,
"status"
,
c
.
ns
,
testType
),
&
example2_v1
.
TestType
{})
if
obj
==
nil
{
return
nil
,
err
}
return
obj
.
(
*
example2_v1
.
TestType
),
err
}
// Delete takes name of the testType and deletes it. Returns an error if one occurs.
func
(
c
*
FakeTestTypes
)
Delete
(
name
string
,
options
*
v1
.
DeleteOptions
)
error
{
_
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewDeleteAction
(
testtypesResource
,
c
.
ns
,
name
),
&
example2_v1
.
TestType
{})
return
err
}
// DeleteCollection deletes a collection of objects.
func
(
c
*
FakeTestTypes
)
DeleteCollection
(
options
*
v1
.
DeleteOptions
,
listOptions
v1
.
ListOptions
)
error
{
action
:=
testing
.
NewDeleteCollectionAction
(
testtypesResource
,
c
.
ns
,
listOptions
)
_
,
err
:=
c
.
Fake
.
Invokes
(
action
,
&
example2_v1
.
TestTypeList
{})
return
err
}
// Patch applies the patch and returns the patched testType.
func
(
c
*
FakeTestTypes
)
Patch
(
name
string
,
pt
types
.
PatchType
,
data
[]
byte
,
subresources
...
string
)
(
result
*
example2_v1
.
TestType
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
testing
.
NewPatchSubresourceAction
(
testtypesResource
,
c
.
ns
,
name
,
data
,
subresources
...
),
&
example2_v1
.
TestType
{})
if
obj
==
nil
{
return
nil
,
err
}
return
obj
.
(
*
example2_v1
.
TestType
),
err
}
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/generated_expansion.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
package
v1
type
TestTypeExpansion
interface
{}
staging/src/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
package
v1
import
(
meta_v1
"k8s.io/apimachinery/pkg/apis/meta/v1"
types
"k8s.io/apimachinery/pkg/types"
watch
"k8s.io/apimachinery/pkg/watch"
rest
"k8s.io/client-go/rest"
v1
"k8s.io/code-generator/_examples/apiserver/apis/example2/v1"
scheme
"k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme"
)
// TestTypesGetter has a method to return a TestTypeInterface.
// A group's client should implement this interface.
type
TestTypesGetter
interface
{
TestTypes
(
namespace
string
)
TestTypeInterface
}
// TestTypeInterface has methods to work with TestType resources.
type
TestTypeInterface
interface
{
Create
(
*
v1
.
TestType
)
(
*
v1
.
TestType
,
error
)
Update
(
*
v1
.
TestType
)
(
*
v1
.
TestType
,
error
)
UpdateStatus
(
*
v1
.
TestType
)
(
*
v1
.
TestType
,
error
)
Delete
(
name
string
,
options
*
meta_v1
.
DeleteOptions
)
error
DeleteCollection
(
options
*
meta_v1
.
DeleteOptions
,
listOptions
meta_v1
.
ListOptions
)
error
Get
(
name
string
,
options
meta_v1
.
GetOptions
)
(
*
v1
.
TestType
,
error
)
List
(
opts
meta_v1
.
ListOptions
)
(
*
v1
.
TestTypeList
,
error
)
Watch
(
opts
meta_v1
.
ListOptions
)
(
watch
.
Interface
,
error
)
Patch
(
name
string
,
pt
types
.
PatchType
,
data
[]
byte
,
subresources
...
string
)
(
result
*
v1
.
TestType
,
err
error
)
TestTypeExpansion
}
// testTypes implements TestTypeInterface
type
testTypes
struct
{
client
rest
.
Interface
ns
string
}
// newTestTypes returns a TestTypes
func
newTestTypes
(
c
*
SecondExampleV1Client
,
namespace
string
)
*
testTypes
{
return
&
testTypes
{
client
:
c
.
RESTClient
(),
ns
:
namespace
,
}
}
// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any.
func
(
c
*
testTypes
)
Get
(
name
string
,
options
meta_v1
.
GetOptions
)
(
result
*
v1
.
TestType
,
err
error
)
{
result
=
&
v1
.
TestType
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
Name
(
name
)
.
VersionedParams
(
&
options
,
scheme
.
ParameterCodec
)
.
Do
()
.
Into
(
result
)
return
}
// List takes label and field selectors, and returns the list of TestTypes that match those selectors.
func
(
c
*
testTypes
)
List
(
opts
meta_v1
.
ListOptions
)
(
result
*
v1
.
TestTypeList
,
err
error
)
{
result
=
&
v1
.
TestTypeList
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
VersionedParams
(
&
opts
,
scheme
.
ParameterCodec
)
.
Do
()
.
Into
(
result
)
return
}
// Watch returns a watch.Interface that watches the requested testTypes.
func
(
c
*
testTypes
)
Watch
(
opts
meta_v1
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
opts
.
Watch
=
true
return
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
VersionedParams
(
&
opts
,
scheme
.
ParameterCodec
)
.
Watch
()
}
// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any.
func
(
c
*
testTypes
)
Create
(
testType
*
v1
.
TestType
)
(
result
*
v1
.
TestType
,
err
error
)
{
result
=
&
v1
.
TestType
{}
err
=
c
.
client
.
Post
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
Body
(
testType
)
.
Do
()
.
Into
(
result
)
return
}
// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any.
func
(
c
*
testTypes
)
Update
(
testType
*
v1
.
TestType
)
(
result
*
v1
.
TestType
,
err
error
)
{
result
=
&
v1
.
TestType
{}
err
=
c
.
client
.
Put
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
Name
(
testType
.
Name
)
.
Body
(
testType
)
.
Do
()
.
Into
(
result
)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func
(
c
*
testTypes
)
UpdateStatus
(
testType
*
v1
.
TestType
)
(
result
*
v1
.
TestType
,
err
error
)
{
result
=
&
v1
.
TestType
{}
err
=
c
.
client
.
Put
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
Name
(
testType
.
Name
)
.
SubResource
(
"status"
)
.
Body
(
testType
)
.
Do
()
.
Into
(
result
)
return
}
// Delete takes name of the testType and deletes it. Returns an error if one occurs.
func
(
c
*
testTypes
)
Delete
(
name
string
,
options
*
meta_v1
.
DeleteOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
Name
(
name
)
.
Body
(
options
)
.
Do
()
.
Error
()
}
// DeleteCollection deletes a collection of objects.
func
(
c
*
testTypes
)
DeleteCollection
(
options
*
meta_v1
.
DeleteOptions
,
listOptions
meta_v1
.
ListOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
VersionedParams
(
&
listOptions
,
scheme
.
ParameterCodec
)
.
Body
(
options
)
.
Do
()
.
Error
()
}
// Patch applies the patch and returns the patched testType.
func
(
c
*
testTypes
)
Patch
(
name
string
,
pt
types
.
PatchType
,
data
[]
byte
,
subresources
...
string
)
(
result
*
v1
.
TestType
,
err
error
)
{
result
=
&
v1
.
TestType
{}
err
=
c
.
client
.
Patch
(
pt
)
.
Namespace
(
c
.
ns
)
.
Resource
(
"testtypes"
)
.
SubResource
(
subresources
...
)
.
Name
(
name
)
.
Body
(
data
)
.
Do
()
.
Into
(
result
)
return
}
staging/src/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/interface.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
// This file was automatically generated by informer-gen
package
example
import
(
v1
"k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/v1"
internalinterfaces
"k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces"
)
// Interface provides access to each of this group's versions.
type
Interface
interface
{
// V1 provides access to shared informers for resources in V1.
V1
()
v1
.
Interface
}
type
group
struct
{
factory
internalinterfaces
.
SharedInformerFactory
namespace
string
tweakListOptions
internalinterfaces
.
TweakListOptionsFunc
}
// New returns a new Interface.
func
New
(
f
internalinterfaces
.
SharedInformerFactory
,
namespace
string
,
tweakListOptions
internalinterfaces
.
TweakListOptionsFunc
)
Interface
{
return
&
group
{
factory
:
f
,
namespace
:
namespace
,
tweakListOptions
:
tweakListOptions
}
}
// V1 returns a new v1.Interface.
func
(
g
*
group
)
V1
()
v1
.
Interface
{
return
v1
.
New
(
g
.
factory
,
g
.
namespace
,
g
.
tweakListOptions
)
}
staging/src/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/v1/interface.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
// This file was automatically generated by informer-gen
package
v1
import
(
internalinterfaces
"k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces"
)
// Interface provides access to all the informers in this group version.
type
Interface
interface
{
// TestTypes returns a TestTypeInformer.
TestTypes
()
TestTypeInformer
}
type
version
struct
{
factory
internalinterfaces
.
SharedInformerFactory
namespace
string
tweakListOptions
internalinterfaces
.
TweakListOptionsFunc
}
// New returns a new Interface.
func
New
(
f
internalinterfaces
.
SharedInformerFactory
,
namespace
string
,
tweakListOptions
internalinterfaces
.
TweakListOptionsFunc
)
Interface
{
return
&
version
{
factory
:
f
,
namespace
:
namespace
,
tweakListOptions
:
tweakListOptions
}
}
// TestTypes returns a TestTypeInformer.
func
(
v
*
version
)
TestTypes
()
TestTypeInformer
{
return
&
testTypeInformer
{
factory
:
v
.
factory
,
namespace
:
v
.
namespace
,
tweakListOptions
:
v
.
tweakListOptions
}
}
staging/src/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/v1/testtype.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
// This file was automatically generated by informer-gen
package
v1
import
(
meta_v1
"k8s.io/apimachinery/pkg/apis/meta/v1"
runtime
"k8s.io/apimachinery/pkg/runtime"
watch
"k8s.io/apimachinery/pkg/watch"
cache
"k8s.io/client-go/tools/cache"
example2_v1
"k8s.io/code-generator/_examples/apiserver/apis/example2/v1"
versioned
"k8s.io/code-generator/_examples/apiserver/clientset/versioned"
internalinterfaces
"k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces"
v1
"k8s.io/code-generator/_examples/apiserver/listers/example2/v1"
time
"time"
)
// TestTypeInformer provides access to a shared informer and lister for
// TestTypes.
type
TestTypeInformer
interface
{
Informer
()
cache
.
SharedIndexInformer
Lister
()
v1
.
TestTypeLister
}
type
testTypeInformer
struct
{
factory
internalinterfaces
.
SharedInformerFactory
tweakListOptions
internalinterfaces
.
TweakListOptionsFunc
namespace
string
}
// NewTestTypeInformer constructs a new informer for TestType type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func
NewTestTypeInformer
(
client
versioned
.
Interface
,
namespace
string
,
resyncPeriod
time
.
Duration
,
indexers
cache
.
Indexers
)
cache
.
SharedIndexInformer
{
return
NewFilteredTestTypeInformer
(
client
,
namespace
,
resyncPeriod
,
indexers
,
nil
)
}
// NewFilteredTestTypeInformer constructs a new informer for TestType type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func
NewFilteredTestTypeInformer
(
client
versioned
.
Interface
,
namespace
string
,
resyncPeriod
time
.
Duration
,
indexers
cache
.
Indexers
,
tweakListOptions
internalinterfaces
.
TweakListOptionsFunc
)
cache
.
SharedIndexInformer
{
return
cache
.
NewSharedIndexInformer
(
&
cache
.
ListWatch
{
ListFunc
:
func
(
options
meta_v1
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
if
tweakListOptions
!=
nil
{
tweakListOptions
(
&
options
)
}
return
client
.
SecondExampleV1
()
.
TestTypes
(
namespace
)
.
List
(
options
)
},
WatchFunc
:
func
(
options
meta_v1
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
if
tweakListOptions
!=
nil
{
tweakListOptions
(
&
options
)
}
return
client
.
SecondExampleV1
()
.
TestTypes
(
namespace
)
.
Watch
(
options
)
},
},
&
example2_v1
.
TestType
{},
resyncPeriod
,
indexers
,
)
}
func
(
f
*
testTypeInformer
)
defaultInformer
(
client
versioned
.
Interface
,
resyncPeriod
time
.
Duration
)
cache
.
SharedIndexInformer
{
return
NewFilteredTestTypeInformer
(
client
,
f
.
namespace
,
resyncPeriod
,
cache
.
Indexers
{
cache
.
NamespaceIndex
:
cache
.
MetaNamespaceIndexFunc
},
f
.
tweakListOptions
)
}
func
(
f
*
testTypeInformer
)
Informer
()
cache
.
SharedIndexInformer
{
return
f
.
factory
.
InformerFor
(
&
example2_v1
.
TestType
{},
f
.
defaultInformer
)
}
func
(
f
*
testTypeInformer
)
Lister
()
v1
.
TestTypeLister
{
return
v1
.
NewTestTypeLister
(
f
.
Informer
()
.
GetIndexer
())
}
staging/src/k8s.io/code-generator/_examples/apiserver/informers/externalversions/factory.go
View file @
2779de53
...
@@ -25,6 +25,7 @@ import (
...
@@ -25,6 +25,7 @@ import (
cache
"k8s.io/client-go/tools/cache"
cache
"k8s.io/client-go/tools/cache"
versioned
"k8s.io/code-generator/_examples/apiserver/clientset/versioned"
versioned
"k8s.io/code-generator/_examples/apiserver/clientset/versioned"
example
"k8s.io/code-generator/_examples/apiserver/informers/externalversions/example"
example
"k8s.io/code-generator/_examples/apiserver/informers/externalversions/example"
example2
"k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2"
internalinterfaces
"k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces"
internalinterfaces
"k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces"
reflect
"reflect"
reflect
"reflect"
sync
"sync"
sync
"sync"
...
@@ -123,8 +124,13 @@ type SharedInformerFactory interface {
...
@@ -123,8 +124,13 @@ type SharedInformerFactory interface {
WaitForCacheSync
(
stopCh
<-
chan
struct
{})
map
[
reflect
.
Type
]
bool
WaitForCacheSync
(
stopCh
<-
chan
struct
{})
map
[
reflect
.
Type
]
bool
Example
()
example
.
Interface
Example
()
example
.
Interface
SecondExample
()
example2
.
Interface
}
}
func
(
f
*
sharedInformerFactory
)
Example
()
example
.
Interface
{
func
(
f
*
sharedInformerFactory
)
Example
()
example
.
Interface
{
return
example
.
New
(
f
,
f
.
namespace
,
f
.
tweakListOptions
)
return
example
.
New
(
f
,
f
.
namespace
,
f
.
tweakListOptions
)
}
}
func
(
f
*
sharedInformerFactory
)
SecondExample
()
example2
.
Interface
{
return
example2
.
New
(
f
,
f
.
namespace
,
f
.
tweakListOptions
)
}
staging/src/k8s.io/code-generator/_examples/apiserver/informers/externalversions/generic.go
View file @
2779de53
...
@@ -23,6 +23,7 @@ import (
...
@@ -23,6 +23,7 @@ import (
schema
"k8s.io/apimachinery/pkg/runtime/schema"
schema
"k8s.io/apimachinery/pkg/runtime/schema"
cache
"k8s.io/client-go/tools/cache"
cache
"k8s.io/client-go/tools/cache"
v1
"k8s.io/code-generator/_examples/apiserver/apis/example/v1"
v1
"k8s.io/code-generator/_examples/apiserver/apis/example/v1"
example2_v1
"k8s.io/code-generator/_examples/apiserver/apis/example2/v1"
)
)
// GenericInformer is type of SharedIndexInformer which will locate and delegate to other
// GenericInformer is type of SharedIndexInformer which will locate and delegate to other
...
@@ -55,6 +56,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
...
@@ -55,6 +56,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
case
v1
.
SchemeGroupVersion
.
WithResource
(
"testtypes"
)
:
case
v1
.
SchemeGroupVersion
.
WithResource
(
"testtypes"
)
:
return
&
genericInformer
{
resource
:
resource
.
GroupResource
(),
informer
:
f
.
Example
()
.
V1
()
.
TestTypes
()
.
Informer
()},
nil
return
&
genericInformer
{
resource
:
resource
.
GroupResource
(),
informer
:
f
.
Example
()
.
V1
()
.
TestTypes
()
.
Informer
()},
nil
// Group=example.test.apiserver.code-generator.k8s.io, Version=v1
case
example2_v1
.
SchemeGroupVersion
.
WithResource
(
"testtypes"
)
:
return
&
genericInformer
{
resource
:
resource
.
GroupResource
(),
informer
:
f
.
SecondExample
()
.
V1
()
.
TestTypes
()
.
Informer
()},
nil
}
}
return
nil
,
fmt
.
Errorf
(
"no informer found for %v"
,
resource
)
return
nil
,
fmt
.
Errorf
(
"no informer found for %v"
,
resource
)
...
...
staging/src/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/interface.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
// This file was automatically generated by informer-gen
package
example
import
(
internalversion
"k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion"
internalinterfaces
"k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces"
)
// Interface provides access to each of this group's versions.
type
Interface
interface
{
// InternalVersion provides access to shared informers for resources in InternalVersion.
InternalVersion
()
internalversion
.
Interface
}
type
group
struct
{
factory
internalinterfaces
.
SharedInformerFactory
namespace
string
tweakListOptions
internalinterfaces
.
TweakListOptionsFunc
}
// New returns a new Interface.
func
New
(
f
internalinterfaces
.
SharedInformerFactory
,
namespace
string
,
tweakListOptions
internalinterfaces
.
TweakListOptionsFunc
)
Interface
{
return
&
group
{
factory
:
f
,
namespace
:
namespace
,
tweakListOptions
:
tweakListOptions
}
}
// InternalVersion returns a new internalversion.Interface.
func
(
g
*
group
)
InternalVersion
()
internalversion
.
Interface
{
return
internalversion
.
New
(
g
.
factory
,
g
.
namespace
,
g
.
tweakListOptions
)
}
staging/src/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/interface.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
// This file was automatically generated by informer-gen
package
internalversion
import
(
internalinterfaces
"k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces"
)
// Interface provides access to all the informers in this group version.
type
Interface
interface
{
// TestTypes returns a TestTypeInformer.
TestTypes
()
TestTypeInformer
}
type
version
struct
{
factory
internalinterfaces
.
SharedInformerFactory
namespace
string
tweakListOptions
internalinterfaces
.
TweakListOptionsFunc
}
// New returns a new Interface.
func
New
(
f
internalinterfaces
.
SharedInformerFactory
,
namespace
string
,
tweakListOptions
internalinterfaces
.
TweakListOptionsFunc
)
Interface
{
return
&
version
{
factory
:
f
,
namespace
:
namespace
,
tweakListOptions
:
tweakListOptions
}
}
// TestTypes returns a TestTypeInformer.
func
(
v
*
version
)
TestTypes
()
TestTypeInformer
{
return
&
testTypeInformer
{
factory
:
v
.
factory
,
namespace
:
v
.
namespace
,
tweakListOptions
:
v
.
tweakListOptions
}
}
staging/src/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/testtype.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
// This file was automatically generated by informer-gen
package
internalversion
import
(
v1
"k8s.io/apimachinery/pkg/apis/meta/v1"
runtime
"k8s.io/apimachinery/pkg/runtime"
watch
"k8s.io/apimachinery/pkg/watch"
cache
"k8s.io/client-go/tools/cache"
example2
"k8s.io/code-generator/_examples/apiserver/apis/example2"
clientset_internalversion
"k8s.io/code-generator/_examples/apiserver/clientset/internalversion"
internalinterfaces
"k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces"
internalversion
"k8s.io/code-generator/_examples/apiserver/listers/example2/internalversion"
time
"time"
)
// TestTypeInformer provides access to a shared informer and lister for
// TestTypes.
type
TestTypeInformer
interface
{
Informer
()
cache
.
SharedIndexInformer
Lister
()
internalversion
.
TestTypeLister
}
type
testTypeInformer
struct
{
factory
internalinterfaces
.
SharedInformerFactory
tweakListOptions
internalinterfaces
.
TweakListOptionsFunc
namespace
string
}
// NewTestTypeInformer constructs a new informer for TestType type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func
NewTestTypeInformer
(
client
clientset_internalversion
.
Interface
,
namespace
string
,
resyncPeriod
time
.
Duration
,
indexers
cache
.
Indexers
)
cache
.
SharedIndexInformer
{
return
NewFilteredTestTypeInformer
(
client
,
namespace
,
resyncPeriod
,
indexers
,
nil
)
}
// NewFilteredTestTypeInformer constructs a new informer for TestType type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func
NewFilteredTestTypeInformer
(
client
clientset_internalversion
.
Interface
,
namespace
string
,
resyncPeriod
time
.
Duration
,
indexers
cache
.
Indexers
,
tweakListOptions
internalinterfaces
.
TweakListOptionsFunc
)
cache
.
SharedIndexInformer
{
return
cache
.
NewSharedIndexInformer
(
&
cache
.
ListWatch
{
ListFunc
:
func
(
options
v1
.
ListOptions
)
(
runtime
.
Object
,
error
)
{
if
tweakListOptions
!=
nil
{
tweakListOptions
(
&
options
)
}
return
client
.
SecondExample
()
.
TestTypes
(
namespace
)
.
List
(
options
)
},
WatchFunc
:
func
(
options
v1
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
if
tweakListOptions
!=
nil
{
tweakListOptions
(
&
options
)
}
return
client
.
SecondExample
()
.
TestTypes
(
namespace
)
.
Watch
(
options
)
},
},
&
example2
.
TestType
{},
resyncPeriod
,
indexers
,
)
}
func
(
f
*
testTypeInformer
)
defaultInformer
(
client
clientset_internalversion
.
Interface
,
resyncPeriod
time
.
Duration
)
cache
.
SharedIndexInformer
{
return
NewFilteredTestTypeInformer
(
client
,
f
.
namespace
,
resyncPeriod
,
cache
.
Indexers
{
cache
.
NamespaceIndex
:
cache
.
MetaNamespaceIndexFunc
},
f
.
tweakListOptions
)
}
func
(
f
*
testTypeInformer
)
Informer
()
cache
.
SharedIndexInformer
{
return
f
.
factory
.
InformerFor
(
&
example2
.
TestType
{},
f
.
defaultInformer
)
}
func
(
f
*
testTypeInformer
)
Lister
()
internalversion
.
TestTypeLister
{
return
internalversion
.
NewTestTypeLister
(
f
.
Informer
()
.
GetIndexer
())
}
staging/src/k8s.io/code-generator/_examples/apiserver/informers/internalversion/factory.go
View file @
2779de53
...
@@ -25,6 +25,7 @@ import (
...
@@ -25,6 +25,7 @@ import (
cache
"k8s.io/client-go/tools/cache"
cache
"k8s.io/client-go/tools/cache"
internalversion
"k8s.io/code-generator/_examples/apiserver/clientset/internalversion"
internalversion
"k8s.io/code-generator/_examples/apiserver/clientset/internalversion"
example
"k8s.io/code-generator/_examples/apiserver/informers/internalversion/example"
example
"k8s.io/code-generator/_examples/apiserver/informers/internalversion/example"
example2
"k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2"
internalinterfaces
"k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces"
internalinterfaces
"k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces"
reflect
"reflect"
reflect
"reflect"
sync
"sync"
sync
"sync"
...
@@ -123,8 +124,13 @@ type SharedInformerFactory interface {
...
@@ -123,8 +124,13 @@ type SharedInformerFactory interface {
WaitForCacheSync
(
stopCh
<-
chan
struct
{})
map
[
reflect
.
Type
]
bool
WaitForCacheSync
(
stopCh
<-
chan
struct
{})
map
[
reflect
.
Type
]
bool
Example
()
example
.
Interface
Example
()
example
.
Interface
SecondExample
()
example2
.
Interface
}
}
func
(
f
*
sharedInformerFactory
)
Example
()
example
.
Interface
{
func
(
f
*
sharedInformerFactory
)
Example
()
example
.
Interface
{
return
example
.
New
(
f
,
f
.
namespace
,
f
.
tweakListOptions
)
return
example
.
New
(
f
,
f
.
namespace
,
f
.
tweakListOptions
)
}
}
func
(
f
*
sharedInformerFactory
)
SecondExample
()
example2
.
Interface
{
return
example2
.
New
(
f
,
f
.
namespace
,
f
.
tweakListOptions
)
}
staging/src/k8s.io/code-generator/_examples/apiserver/informers/internalversion/generic.go
View file @
2779de53
...
@@ -23,6 +23,7 @@ import (
...
@@ -23,6 +23,7 @@ import (
schema
"k8s.io/apimachinery/pkg/runtime/schema"
schema
"k8s.io/apimachinery/pkg/runtime/schema"
cache
"k8s.io/client-go/tools/cache"
cache
"k8s.io/client-go/tools/cache"
example
"k8s.io/code-generator/_examples/apiserver/apis/example"
example
"k8s.io/code-generator/_examples/apiserver/apis/example"
example2
"k8s.io/code-generator/_examples/apiserver/apis/example2"
)
)
// GenericInformer is type of SharedIndexInformer which will locate and delegate to other
// GenericInformer is type of SharedIndexInformer which will locate and delegate to other
...
@@ -55,6 +56,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
...
@@ -55,6 +56,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
case
example
.
SchemeGroupVersion
.
WithResource
(
"testtypes"
)
:
case
example
.
SchemeGroupVersion
.
WithResource
(
"testtypes"
)
:
return
&
genericInformer
{
resource
:
resource
.
GroupResource
(),
informer
:
f
.
Example
()
.
InternalVersion
()
.
TestTypes
()
.
Informer
()},
nil
return
&
genericInformer
{
resource
:
resource
.
GroupResource
(),
informer
:
f
.
Example
()
.
InternalVersion
()
.
TestTypes
()
.
Informer
()},
nil
// Group=example.test.apiserver.code-generator.k8s.io, Version=internalVersion
case
example2
.
SchemeGroupVersion
.
WithResource
(
"testtypes"
)
:
return
&
genericInformer
{
resource
:
resource
.
GroupResource
(),
informer
:
f
.
SecondExample
()
.
InternalVersion
()
.
TestTypes
()
.
Informer
()},
nil
}
}
return
nil
,
fmt
.
Errorf
(
"no informer found for %v"
,
resource
)
return
nil
,
fmt
.
Errorf
(
"no informer found for %v"
,
resource
)
...
...
staging/src/k8s.io/code-generator/_examples/apiserver/listers/example2/internalversion/expansion_generated.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
// This file was automatically generated by lister-gen
package
internalversion
// TestTypeListerExpansion allows custom methods to be added to
// TestTypeLister.
type
TestTypeListerExpansion
interface
{}
// TestTypeNamespaceListerExpansion allows custom methods to be added to
// TestTypeNamespaceLister.
type
TestTypeNamespaceListerExpansion
interface
{}
staging/src/k8s.io/code-generator/_examples/apiserver/listers/example2/internalversion/testtype.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
// This file was automatically generated by lister-gen
package
internalversion
import
(
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
example2
"k8s.io/code-generator/_examples/apiserver/apis/example2"
)
// TestTypeLister helps list TestTypes.
type
TestTypeLister
interface
{
// List lists all TestTypes in the indexer.
List
(
selector
labels
.
Selector
)
(
ret
[]
*
example2
.
TestType
,
err
error
)
// TestTypes returns an object that can list and get TestTypes.
TestTypes
(
namespace
string
)
TestTypeNamespaceLister
TestTypeListerExpansion
}
// testTypeLister implements the TestTypeLister interface.
type
testTypeLister
struct
{
indexer
cache
.
Indexer
}
// NewTestTypeLister returns a new TestTypeLister.
func
NewTestTypeLister
(
indexer
cache
.
Indexer
)
TestTypeLister
{
return
&
testTypeLister
{
indexer
:
indexer
}
}
// List lists all TestTypes in the indexer.
func
(
s
*
testTypeLister
)
List
(
selector
labels
.
Selector
)
(
ret
[]
*
example2
.
TestType
,
err
error
)
{
err
=
cache
.
ListAll
(
s
.
indexer
,
selector
,
func
(
m
interface
{})
{
ret
=
append
(
ret
,
m
.
(
*
example2
.
TestType
))
})
return
ret
,
err
}
// TestTypes returns an object that can list and get TestTypes.
func
(
s
*
testTypeLister
)
TestTypes
(
namespace
string
)
TestTypeNamespaceLister
{
return
testTypeNamespaceLister
{
indexer
:
s
.
indexer
,
namespace
:
namespace
}
}
// TestTypeNamespaceLister helps list and get TestTypes.
type
TestTypeNamespaceLister
interface
{
// List lists all TestTypes in the indexer for a given namespace.
List
(
selector
labels
.
Selector
)
(
ret
[]
*
example2
.
TestType
,
err
error
)
// Get retrieves the TestType from the indexer for a given namespace and name.
Get
(
name
string
)
(
*
example2
.
TestType
,
error
)
TestTypeNamespaceListerExpansion
}
// testTypeNamespaceLister implements the TestTypeNamespaceLister
// interface.
type
testTypeNamespaceLister
struct
{
indexer
cache
.
Indexer
namespace
string
}
// List lists all TestTypes in the indexer for a given namespace.
func
(
s
testTypeNamespaceLister
)
List
(
selector
labels
.
Selector
)
(
ret
[]
*
example2
.
TestType
,
err
error
)
{
err
=
cache
.
ListAllByNamespace
(
s
.
indexer
,
s
.
namespace
,
selector
,
func
(
m
interface
{})
{
ret
=
append
(
ret
,
m
.
(
*
example2
.
TestType
))
})
return
ret
,
err
}
// Get retrieves the TestType from the indexer for a given namespace and name.
func
(
s
testTypeNamespaceLister
)
Get
(
name
string
)
(
*
example2
.
TestType
,
error
)
{
obj
,
exists
,
err
:=
s
.
indexer
.
GetByKey
(
s
.
namespace
+
"/"
+
name
)
if
err
!=
nil
{
return
nil
,
err
}
if
!
exists
{
return
nil
,
errors
.
NewNotFound
(
example2
.
Resource
(
"testtype"
),
name
)
}
return
obj
.
(
*
example2
.
TestType
),
nil
}
staging/src/k8s.io/code-generator/_examples/apiserver/listers/example2/v1/expansion_generated.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
// This file was automatically generated by lister-gen
package
v1
// TestTypeListerExpansion allows custom methods to be added to
// TestTypeLister.
type
TestTypeListerExpansion
interface
{}
// TestTypeNamespaceListerExpansion allows custom methods to be added to
// TestTypeNamespaceLister.
type
TestTypeNamespaceListerExpansion
interface
{}
staging/src/k8s.io/code-generator/_examples/apiserver/listers/example2/v1/testtype.go
0 → 100644
View file @
2779de53
/*
Copyright 2017 The Kubernetes Authors.
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.
*/
// This file was automatically generated by lister-gen
package
v1
import
(
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
v1
"k8s.io/code-generator/_examples/apiserver/apis/example2/v1"
)
// TestTypeLister helps list TestTypes.
type
TestTypeLister
interface
{
// List lists all TestTypes in the indexer.
List
(
selector
labels
.
Selector
)
(
ret
[]
*
v1
.
TestType
,
err
error
)
// TestTypes returns an object that can list and get TestTypes.
TestTypes
(
namespace
string
)
TestTypeNamespaceLister
TestTypeListerExpansion
}
// testTypeLister implements the TestTypeLister interface.
type
testTypeLister
struct
{
indexer
cache
.
Indexer
}
// NewTestTypeLister returns a new TestTypeLister.
func
NewTestTypeLister
(
indexer
cache
.
Indexer
)
TestTypeLister
{
return
&
testTypeLister
{
indexer
:
indexer
}
}
// List lists all TestTypes in the indexer.
func
(
s
*
testTypeLister
)
List
(
selector
labels
.
Selector
)
(
ret
[]
*
v1
.
TestType
,
err
error
)
{
err
=
cache
.
ListAll
(
s
.
indexer
,
selector
,
func
(
m
interface
{})
{
ret
=
append
(
ret
,
m
.
(
*
v1
.
TestType
))
})
return
ret
,
err
}
// TestTypes returns an object that can list and get TestTypes.
func
(
s
*
testTypeLister
)
TestTypes
(
namespace
string
)
TestTypeNamespaceLister
{
return
testTypeNamespaceLister
{
indexer
:
s
.
indexer
,
namespace
:
namespace
}
}
// TestTypeNamespaceLister helps list and get TestTypes.
type
TestTypeNamespaceLister
interface
{
// List lists all TestTypes in the indexer for a given namespace.
List
(
selector
labels
.
Selector
)
(
ret
[]
*
v1
.
TestType
,
err
error
)
// Get retrieves the TestType from the indexer for a given namespace and name.
Get
(
name
string
)
(
*
v1
.
TestType
,
error
)
TestTypeNamespaceListerExpansion
}
// testTypeNamespaceLister implements the TestTypeNamespaceLister
// interface.
type
testTypeNamespaceLister
struct
{
indexer
cache
.
Indexer
namespace
string
}
// List lists all TestTypes in the indexer for a given namespace.
func
(
s
testTypeNamespaceLister
)
List
(
selector
labels
.
Selector
)
(
ret
[]
*
v1
.
TestType
,
err
error
)
{
err
=
cache
.
ListAllByNamespace
(
s
.
indexer
,
s
.
namespace
,
selector
,
func
(
m
interface
{})
{
ret
=
append
(
ret
,
m
.
(
*
v1
.
TestType
))
})
return
ret
,
err
}
// Get retrieves the TestType from the indexer for a given namespace and name.
func
(
s
testTypeNamespaceLister
)
Get
(
name
string
)
(
*
v1
.
TestType
,
error
)
{
obj
,
exists
,
err
:=
s
.
indexer
.
GetByKey
(
s
.
namespace
+
"/"
+
name
)
if
err
!=
nil
{
return
nil
,
err
}
if
!
exists
{
return
nil
,
errors
.
NewNotFound
(
v1
.
Resource
(
"testtype"
),
name
)
}
return
obj
.
(
*
v1
.
TestType
),
nil
}
staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/clientset.go
View file @
2779de53
...
@@ -22,7 +22,7 @@ import (
...
@@ -22,7 +22,7 @@ import (
rest
"k8s.io/client-go/rest"
rest
"k8s.io/client-go/rest"
flowcontrol
"k8s.io/client-go/util/flowcontrol"
flowcontrol
"k8s.io/client-go/util/flowcontrol"
examplev1
"k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1"
examplev1
"k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1"
example2
v1
"k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1"
secondexample
v1
"k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1"
)
)
type
Interface
interface
{
type
Interface
interface
{
...
@@ -30,9 +30,9 @@ type Interface interface {
...
@@ -30,9 +30,9 @@ type Interface interface {
ExampleV1
()
examplev1
.
ExampleV1Interface
ExampleV1
()
examplev1
.
ExampleV1Interface
// Deprecated: please explicitly pick a version if possible.
// Deprecated: please explicitly pick a version if possible.
Example
()
examplev1
.
ExampleV1Interface
Example
()
examplev1
.
ExampleV1Interface
SecondExampleV1
()
example2
v1
.
SecondExampleV1Interface
SecondExampleV1
()
secondexample
v1
.
SecondExampleV1Interface
// Deprecated: please explicitly pick a version if possible.
// Deprecated: please explicitly pick a version if possible.
SecondExample
()
example2
v1
.
SecondExampleV1Interface
SecondExample
()
secondexample
v1
.
SecondExampleV1Interface
}
}
// Clientset contains the clients for groups. Each group has exactly one
// Clientset contains the clients for groups. Each group has exactly one
...
@@ -40,7 +40,7 @@ type Interface interface {
...
@@ -40,7 +40,7 @@ type Interface interface {
type
Clientset
struct
{
type
Clientset
struct
{
*
discovery
.
DiscoveryClient
*
discovery
.
DiscoveryClient
exampleV1
*
examplev1
.
ExampleV1Client
exampleV1
*
examplev1
.
ExampleV1Client
secondExampleV1
*
example2
v1
.
SecondExampleV1Client
secondExampleV1
*
secondexample
v1
.
SecondExampleV1Client
}
}
// ExampleV1 retrieves the ExampleV1Client
// ExampleV1 retrieves the ExampleV1Client
...
@@ -55,13 +55,13 @@ func (c *Clientset) Example() examplev1.ExampleV1Interface {
...
@@ -55,13 +55,13 @@ func (c *Clientset) Example() examplev1.ExampleV1Interface {
}
}
// SecondExampleV1 retrieves the SecondExampleV1Client
// SecondExampleV1 retrieves the SecondExampleV1Client
func
(
c
*
Clientset
)
SecondExampleV1
()
example2
v1
.
SecondExampleV1Interface
{
func
(
c
*
Clientset
)
SecondExampleV1
()
secondexample
v1
.
SecondExampleV1Interface
{
return
c
.
secondExampleV1
return
c
.
secondExampleV1
}
}
// Deprecated: SecondExample retrieves the default version of SecondExampleClient.
// Deprecated: SecondExample retrieves the default version of SecondExampleClient.
// Please explicitly pick a version.
// Please explicitly pick a version.
func
(
c
*
Clientset
)
SecondExample
()
example2
v1
.
SecondExampleV1Interface
{
func
(
c
*
Clientset
)
SecondExample
()
secondexample
v1
.
SecondExampleV1Interface
{
return
c
.
secondExampleV1
return
c
.
secondExampleV1
}
}
...
@@ -85,7 +85,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
...
@@ -85,7 +85,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
cs
.
secondExampleV1
,
err
=
example2
v1
.
NewForConfig
(
&
configShallowCopy
)
cs
.
secondExampleV1
,
err
=
secondexample
v1
.
NewForConfig
(
&
configShallowCopy
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -103,7 +103,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
...
@@ -103,7 +103,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
func
NewForConfigOrDie
(
c
*
rest
.
Config
)
*
Clientset
{
func
NewForConfigOrDie
(
c
*
rest
.
Config
)
*
Clientset
{
var
cs
Clientset
var
cs
Clientset
cs
.
exampleV1
=
examplev1
.
NewForConfigOrDie
(
c
)
cs
.
exampleV1
=
examplev1
.
NewForConfigOrDie
(
c
)
cs
.
secondExampleV1
=
example2
v1
.
NewForConfigOrDie
(
c
)
cs
.
secondExampleV1
=
secondexample
v1
.
NewForConfigOrDie
(
c
)
cs
.
DiscoveryClient
=
discovery
.
NewDiscoveryClientForConfigOrDie
(
c
)
cs
.
DiscoveryClient
=
discovery
.
NewDiscoveryClientForConfigOrDie
(
c
)
return
&
cs
return
&
cs
...
@@ -113,7 +113,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
...
@@ -113,7 +113,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
func
New
(
c
rest
.
Interface
)
*
Clientset
{
func
New
(
c
rest
.
Interface
)
*
Clientset
{
var
cs
Clientset
var
cs
Clientset
cs
.
exampleV1
=
examplev1
.
New
(
c
)
cs
.
exampleV1
=
examplev1
.
New
(
c
)
cs
.
secondExampleV1
=
example2
v1
.
New
(
c
)
cs
.
secondExampleV1
=
secondexample
v1
.
New
(
c
)
cs
.
DiscoveryClient
=
discovery
.
NewDiscoveryClient
(
c
)
cs
.
DiscoveryClient
=
discovery
.
NewDiscoveryClient
(
c
)
return
&
cs
return
&
cs
...
...
staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/clientset_generated.go
View file @
2779de53
...
@@ -25,8 +25,8 @@ import (
...
@@ -25,8 +25,8 @@ import (
clientset
"k8s.io/code-generator/_examples/crd/clientset/versioned"
clientset
"k8s.io/code-generator/_examples/crd/clientset/versioned"
examplev1
"k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1"
examplev1
"k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1"
fakeexamplev1
"k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake"
fakeexamplev1
"k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake"
example2
v1
"k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1"
secondexample
v1
"k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1"
fake
example2
v1
"k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake"
fake
secondexample
v1
"k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake"
)
)
// NewSimpleClientset returns a clientset that will respond with the provided objects.
// NewSimpleClientset returns a clientset that will respond with the provided objects.
...
@@ -73,11 +73,11 @@ func (c *Clientset) Example() examplev1.ExampleV1Interface {
...
@@ -73,11 +73,11 @@ func (c *Clientset) Example() examplev1.ExampleV1Interface {
}
}
// SecondExampleV1 retrieves the SecondExampleV1Client
// SecondExampleV1 retrieves the SecondExampleV1Client
func
(
c
*
Clientset
)
SecondExampleV1
()
example2
v1
.
SecondExampleV1Interface
{
func
(
c
*
Clientset
)
SecondExampleV1
()
secondexample
v1
.
SecondExampleV1Interface
{
return
&
fake
example2
v1
.
FakeSecondExampleV1
{
Fake
:
&
c
.
Fake
}
return
&
fake
secondexample
v1
.
FakeSecondExampleV1
{
Fake
:
&
c
.
Fake
}
}
}
// SecondExample retrieves the SecondExampleV1Client
// SecondExample retrieves the SecondExampleV1Client
func
(
c
*
Clientset
)
SecondExample
()
example2
v1
.
SecondExampleV1Interface
{
func
(
c
*
Clientset
)
SecondExample
()
secondexample
v1
.
SecondExampleV1Interface
{
return
&
fake
example2
v1
.
FakeSecondExampleV1
{
Fake
:
&
c
.
Fake
}
return
&
fake
secondexample
v1
.
FakeSecondExampleV1
{
Fake
:
&
c
.
Fake
}
}
}
staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/register.go
View file @
2779de53
...
@@ -22,7 +22,7 @@ import (
...
@@ -22,7 +22,7 @@ import (
schema
"k8s.io/apimachinery/pkg/runtime/schema"
schema
"k8s.io/apimachinery/pkg/runtime/schema"
serializer
"k8s.io/apimachinery/pkg/runtime/serializer"
serializer
"k8s.io/apimachinery/pkg/runtime/serializer"
examplev1
"k8s.io/code-generator/_examples/crd/apis/example/v1"
examplev1
"k8s.io/code-generator/_examples/crd/apis/example/v1"
example2
v1
"k8s.io/code-generator/_examples/crd/apis/example2/v1"
secondexample
v1
"k8s.io/code-generator/_examples/crd/apis/example2/v1"
)
)
var
scheme
=
runtime
.
NewScheme
()
var
scheme
=
runtime
.
NewScheme
()
...
@@ -50,6 +50,6 @@ func init() {
...
@@ -50,6 +50,6 @@ func init() {
// correctly.
// correctly.
func
AddToScheme
(
scheme
*
runtime
.
Scheme
)
{
func
AddToScheme
(
scheme
*
runtime
.
Scheme
)
{
examplev1
.
AddToScheme
(
scheme
)
examplev1
.
AddToScheme
(
scheme
)
example2
v1
.
AddToScheme
(
scheme
)
secondexample
v1
.
AddToScheme
(
scheme
)
}
}
staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/scheme/register.go
View file @
2779de53
...
@@ -22,7 +22,7 @@ import (
...
@@ -22,7 +22,7 @@ import (
schema
"k8s.io/apimachinery/pkg/runtime/schema"
schema
"k8s.io/apimachinery/pkg/runtime/schema"
serializer
"k8s.io/apimachinery/pkg/runtime/serializer"
serializer
"k8s.io/apimachinery/pkg/runtime/serializer"
examplev1
"k8s.io/code-generator/_examples/crd/apis/example/v1"
examplev1
"k8s.io/code-generator/_examples/crd/apis/example/v1"
example2
v1
"k8s.io/code-generator/_examples/crd/apis/example2/v1"
secondexample
v1
"k8s.io/code-generator/_examples/crd/apis/example2/v1"
)
)
var
Scheme
=
runtime
.
NewScheme
()
var
Scheme
=
runtime
.
NewScheme
()
...
@@ -50,6 +50,6 @@ func init() {
...
@@ -50,6 +50,6 @@ func init() {
// correctly.
// correctly.
func
AddToScheme
(
scheme
*
runtime
.
Scheme
)
{
func
AddToScheme
(
scheme
*
runtime
.
Scheme
)
{
examplev1
.
AddToScheme
(
scheme
)
examplev1
.
AddToScheme
(
scheme
)
example2
v1
.
AddToScheme
(
scheme
)
secondexample
v1
.
AddToScheme
(
scheme
)
}
}
staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/example2_client.go
View file @
2779de53
...
@@ -28,7 +28,7 @@ type SecondExampleV1Interface interface {
...
@@ -28,7 +28,7 @@ type SecondExampleV1Interface interface {
TestTypesGetter
TestTypesGetter
}
}
// SecondExampleV1Client is used to interact with features provided by the example.test
2
.crd.code-generator.k8s.io group.
// SecondExampleV1Client is used to interact with features provided by the example.test.crd.code-generator.k8s.io group.
type
SecondExampleV1Client
struct
{
type
SecondExampleV1Client
struct
{
restClient
rest
.
Interface
restClient
rest
.
Interface
}
}
...
...
staging/src/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_testtype.go
View file @
2779de53
...
@@ -32,9 +32,9 @@ type FakeTestTypes struct {
...
@@ -32,9 +32,9 @@ type FakeTestTypes struct {
ns
string
ns
string
}
}
var
testtypesResource
=
schema
.
GroupVersionResource
{
Group
:
"example.test
2
.crd.code-generator.k8s.io"
,
Version
:
"v1"
,
Resource
:
"testtypes"
}
var
testtypesResource
=
schema
.
GroupVersionResource
{
Group
:
"example.test.crd.code-generator.k8s.io"
,
Version
:
"v1"
,
Resource
:
"testtypes"
}
var
testtypesKind
=
schema
.
GroupVersionKind
{
Group
:
"example.test
2
.crd.code-generator.k8s.io"
,
Version
:
"v1"
,
Kind
:
"TestType"
}
var
testtypesKind
=
schema
.
GroupVersionKind
{
Group
:
"example.test.crd.code-generator.k8s.io"
,
Version
:
"v1"
,
Kind
:
"TestType"
}
// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any.
// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any.
func
(
c
*
FakeTestTypes
)
Get
(
name
string
,
options
v1
.
GetOptions
)
(
result
*
example2_v1
.
TestType
,
err
error
)
{
func
(
c
*
FakeTestTypes
)
Get
(
name
string
,
options
v1
.
GetOptions
)
(
result
*
example2_v1
.
TestType
,
err
error
)
{
...
...
staging/src/k8s.io/code-generator/_examples/crd/informers/externalversions/example2/interface.go
View file @
2779de53
...
@@ -16,7 +16,7 @@ limitations under the License.
...
@@ -16,7 +16,7 @@ limitations under the License.
// This file was automatically generated by informer-gen
// This file was automatically generated by informer-gen
package
example
2
package
example
import
(
import
(
v1
"k8s.io/code-generator/_examples/crd/informers/externalversions/example2/v1"
v1
"k8s.io/code-generator/_examples/crd/informers/externalversions/example2/v1"
...
...
staging/src/k8s.io/code-generator/_examples/crd/informers/externalversions/generic.go
View file @
2779de53
...
@@ -56,7 +56,7 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
...
@@ -56,7 +56,7 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
case
v1
.
SchemeGroupVersion
.
WithResource
(
"testtypes"
)
:
case
v1
.
SchemeGroupVersion
.
WithResource
(
"testtypes"
)
:
return
&
genericInformer
{
resource
:
resource
.
GroupResource
(),
informer
:
f
.
Example
()
.
V1
()
.
TestTypes
()
.
Informer
()},
nil
return
&
genericInformer
{
resource
:
resource
.
GroupResource
(),
informer
:
f
.
Example
()
.
V1
()
.
TestTypes
()
.
Informer
()},
nil
// Group=example.test
2
.crd.code-generator.k8s.io, Version=v1
// Group=example.test.crd.code-generator.k8s.io, Version=v1
case
example2_v1
.
SchemeGroupVersion
.
WithResource
(
"testtypes"
)
:
case
example2_v1
.
SchemeGroupVersion
.
WithResource
(
"testtypes"
)
:
return
&
genericInformer
{
resource
:
resource
.
GroupResource
(),
informer
:
f
.
SecondExample
()
.
V1
()
.
TestTypes
()
.
Informer
()},
nil
return
&
genericInformer
{
resource
:
resource
.
GroupResource
(),
informer
:
f
.
SecondExample
()
.
V1
()
.
TestTypes
()
.
Informer
()},
nil
...
...
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