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
ec9771cc
Commit
ec9771cc
authored
Jan 12, 2016
by
Chao Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add nonNamespaced comment tag; change the interface name
parent
b7438274
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
183 additions
and
144 deletions
+183
-144
generator-for-group.go
cmd/libs/go2idl/client-gen/generators/generator-for-group.go
+16
-4
generator-for-type.go
cmd/libs/go2idl/client-gen/generators/generator-for-type.go
+59
-18
testgroup_client.go
...-gen/testoutput/testgroup/unversioned/testgroup_client.go
+1
-1
testtype.go
...l/client-gen/testoutput/testgroup/unversioned/testtype.go
+3
-2
types.go
pkg/api/types.go
+4
-4
daemonset.go
...lient/typed/generated/extensions/unversioned/daemonset.go
+3
-2
deployment.go
...ient/typed/generated/extensions/unversioned/deployment.go
+3
-2
extensions_client.go
...ped/generated/extensions/unversioned/extensions_client.go
+6
-6
horizontalpodautoscaler.go
...nerated/extensions/unversioned/horizontalpodautoscaler.go
+3
-2
ingress.go
pkg/client/typed/generated/extensions/unversioned/ingress.go
+3
-2
job.go
pkg/client/typed/generated/extensions/unversioned/job.go
+3
-2
thirdpartyresource.go
...ed/generated/extensions/unversioned/thirdpartyresource.go
+3
-2
componentstatus.go
...ent/typed/generated/legacy/unversioned/componentstatus.go
+5
-13
endpoints.go
pkg/client/typed/generated/legacy/unversioned/endpoints.go
+3
-2
event.go
pkg/client/typed/generated/legacy/unversioned/event.go
+3
-2
legacy_client.go
...lient/typed/generated/legacy/unversioned/legacy_client.go
+23
-23
limitrange.go
pkg/client/typed/generated/legacy/unversioned/limitrange.go
+3
-2
namespace.go
pkg/client/typed/generated/legacy/unversioned/namespace.go
+5
-13
node.go
pkg/client/typed/generated/legacy/unversioned/node.go
+5
-13
persistentvolume.go
...nt/typed/generated/legacy/unversioned/persistentvolume.go
+5
-13
persistentvolumeclaim.go
...ped/generated/legacy/unversioned/persistentvolumeclaim.go
+3
-2
pod.go
pkg/client/typed/generated/legacy/unversioned/pod.go
+3
-2
podtemplate.go
pkg/client/typed/generated/legacy/unversioned/podtemplate.go
+3
-2
replicationcontroller.go
...ped/generated/legacy/unversioned/replicationcontroller.go
+3
-2
resourcequota.go
...lient/typed/generated/legacy/unversioned/resourcequota.go
+3
-2
secret.go
pkg/client/typed/generated/legacy/unversioned/secret.go
+3
-2
service.go
pkg/client/typed/generated/legacy/unversioned/service.go
+3
-2
serviceaccount.go
...ient/typed/generated/legacy/unversioned/serviceaccount.go
+3
-2
No files found.
cmd/libs/go2idl/client-gen/generators/generator-for-group.go
View file @
ec9771cc
...
...
@@ -89,7 +89,13 @@ func (g *genGroup) GenerateType(c *generator.Context, t *types.Type, w io.Writer
"type"
:
t
,
"Group"
:
namer
.
IC
(
g
.
group
),
}
sw
.
Do
(
namespacerImplTemplate
,
wrapper
)
namespaced
:=
!
(
types
.
ExtractCommentTags
(
"+"
,
t
.
SecondClosestCommentLines
)[
"nonNamespaced"
]
==
"true"
)
if
namespaced
{
sw
.
Do
(
getterImplNamespaced
,
wrapper
)
}
else
{
sw
.
Do
(
getterImplNonNamespaced
,
wrapper
)
}
}
sw
.
Do
(
newClientForConfigTemplate
,
m
)
sw
.
Do
(
newClientForConfigOrDieTemplate
,
m
)
...
...
@@ -101,7 +107,7 @@ func (g *genGroup) GenerateType(c *generator.Context, t *types.Type, w io.Writer
var
groupInterfaceTemplate
=
`
type $.Group$Interface interface {
$range .types$ $.
Name.Name$Namespac
er
$range .types$ $.
|publicPlural$Gett
er
$end$
}
`
...
...
@@ -113,12 +119,18 @@ type $.Group$Client struct {
}
`
var
namespacerImplTemplate
=
`
func (c *$.Group$Client) $.type|publicPlural$(namespace string) $.type
.Name.Name
$Interface {
var
getterImplNamespaced
=
`
func (c *$.Group$Client) $.type|publicPlural$(namespace string) $.type
|public
$Interface {
return new$.type|publicPlural$(c, namespace)
}
`
var
getterImplNonNamespaced
=
`
func (c *$.Group$Client) $.type|publicPlural$() $.type|public$Interface {
return new$.type|publicPlural$(c)
}
`
var
newClientForConfigTemplate
=
`
// NewForConfig creates a new $.Group$Client for the given config.
func NewForConfig(c *$.Config|raw$) (*$.Group$Client, error) {
...
...
cmd/libs/go2idl/client-gen/generators/generator-for-type.go
View file @
ec9771cc
...
...
@@ -66,6 +66,7 @@ func hasStatus(t *types.Type) bool {
func
(
g
*
genClientForType
)
GenerateType
(
c
*
generator
.
Context
,
t
*
types
.
Type
,
w
io
.
Writer
)
error
{
sw
:=
generator
.
NewSnippetWriter
(
w
,
c
,
"$"
,
"$"
)
pkg
:=
filepath
.
Base
(
t
.
Name
.
Package
)
namespaced
:=
!
(
types
.
ExtractCommentTags
(
"+"
,
t
.
SecondClosestCommentLines
)[
"nonNamespaced"
]
==
"true"
)
m
:=
map
[
string
]
interface
{}{
"type"
:
t
,
"package"
:
pkg
,
...
...
@@ -74,16 +75,28 @@ func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w i
"watchInterface"
:
c
.
Universe
.
Type
(
types
.
Name
{
Package
:
"k8s.io/kubernetes/pkg/watch"
,
Name
:
"Interface"
}),
"apiDeleteOptions"
:
c
.
Universe
.
Type
(
types
.
Name
{
Package
:
"k8s.io/kubernetes/pkg/api"
,
Name
:
"DeleteOptions"
}),
"apiListOptions"
:
c
.
Universe
.
Type
(
types
.
Name
{
Package
:
"k8s.io/kubernetes/pkg/api"
,
Name
:
"ListOptions"
}),
"namespaced"
:
namespaced
,
}
sw
.
Do
(
getterComment
,
m
)
if
namespaced
{
sw
.
Do
(
getterNamesapced
,
m
)
}
else
{
sw
.
Do
(
getterNonNamesapced
,
m
)
}
sw
.
Do
(
namespacerTemplate
,
m
)
sw
.
Do
(
interfaceTemplate1
,
m
)
// Include the UpdateStatus method if the type has a status
if
hasStatus
(
t
)
{
sw
.
Do
(
interfaceUpdateStatusTemplate
,
m
)
}
sw
.
Do
(
interfaceTemplate2
,
m
)
sw
.
Do
(
structTemplate
,
m
)
sw
.
Do
(
newStructTemplate
,
m
)
if
namespaced
{
sw
.
Do
(
structNamespaced
,
m
)
sw
.
Do
(
newStructNamespaced
,
m
)
}
else
{
sw
.
Do
(
structNonNamespaced
,
m
)
sw
.
Do
(
newStructNonNamespaced
,
m
)
}
sw
.
Do
(
createTemplate
,
m
)
sw
.
Do
(
updateTemplate
,
m
)
// Generate the UpdateStatus method if the type has a status
...
...
@@ -99,15 +112,24 @@ func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w i
return
sw
.
Error
()
}
// template for namespacer
var
namespacerTemplate
=
`
// $.type|public$Namespacer has methods to work with $.type|public$ resources in a namespace
type $.type|public$Namespacer interface {
// group client will implement this interface.
var
getterComment
=
`
// $.type|publicPlural$Getter has a method to return a $.type|public$Interface.
// A group's client should implement this interface.`
var
getterNamesapced
=
`
type $.type|publicPlural$Getter interface {
$.type|publicPlural$(namespace string) $.type|public$Interface
}
`
// template for the Interface
var
getterNonNamesapced
=
`
type $.type|publicPlural$Getter interface {
$.type|publicPlural$() $.type|public$Interface
}
`
// this type's interface, typed client will implement this interface.
var
interfaceTemplate1
=
`
// $.type|public$Interface has methods to work with $.type|public$ resources.
type $.type|public$Interface interface {
...
...
@@ -128,15 +150,24 @@ var interfaceTemplate2 = `
}
`
// template for the struct that implements the interface
var
struct
Template
=
`
// template for the struct that implements the
type's
interface
var
struct
Namespaced
=
`
// $.type|privatePlural$ implements $.type|public$Interface
type $.type|privatePlural$ struct {
client *$.Group$Client
ns string
}
`
var
newStructTemplate
=
`
// template for the struct that implements the type's interface
var
structNonNamespaced
=
`
// $.type|privatePlural$ implements $.type|public$Interface
type $.type|privatePlural$ struct {
client *$.Group$Client
}
`
var
newStructNamespaced
=
`
// new$.type|publicPlural$ returns a $.type|publicPlural$
func new$.type|publicPlural$(c *$.Group$Client, namespace string) *$.type|privatePlural$ {
return &$.type|privatePlural${
...
...
@@ -145,12 +176,22 @@ func new$.type|publicPlural$(c *$.Group$Client, namespace string) *$.type|privat
}
}
`
var
newStructNonNamespaced
=
`
// new$.type|publicPlural$ returns a $.type|publicPlural$
func new$.type|publicPlural$(c *$.Group$Client) *$.type|privatePlural$ {
return &$.type|privatePlural${
client: c,
}
}
`
var
listTemplate
=
`
// List takes label and field selectors, and returns the list of $.type|publicPlural$ that match those selectors.
func (c *$.type|privatePlural$) List(opts $.apiListOptions|raw$) (result *$.type|raw$List, err error) {
result = &$.type|raw$List{}
err = c.client.Get().
Namespace(c.ns).
$if .namespaced$Namespace(c.ns).$end$
Resource("$.type|privatePlural$").
VersionedParams(&opts, api.Scheme).
Do().
...
...
@@ -163,7 +204,7 @@ var getTemplate = `
func (c *$.type|privatePlural$) Get(name string) (result *$.type|raw$, err error) {
result = &$.type|raw${}
err = c.client.Get().
Namespace(c.ns).
$if .namespaced$Namespace(c.ns).$end$
Resource("$.type|privatePlural$").
Name(name).
Do().
...
...
@@ -176,7 +217,7 @@ var deleteTemplate = `
// Delete takes name of the $.type|private$ and deletes it. Returns an error if one occurs.
func (c *$.type|privatePlural$) Delete(name string, options *$.apiDeleteOptions|raw$) error {
return c.client.Delete().
Namespace(c.ns).
$if .namespaced$Namespace(c.ns).$end$
Resource("$.type|privatePlural$").
Name(name).
Body(options).
...
...
@@ -189,7 +230,7 @@ var deleteCollectionTemplate = `
// DeleteCollection deletes a collection of objects.
func (c *$.type|privatePlural$) DeleteCollection(options *$.apiDeleteOptions|raw$, listOptions $.apiListOptions|raw$) error {
return c.client.Delete().
Namespace(c.ns).
$if .namespaced$Namespace(c.ns).$end$
Resource("$.type|privatePlural$").
VersionedParams(&listOptions, api.Scheme).
Body(options).
...
...
@@ -203,7 +244,7 @@ var createTemplate = `
func (c *$.type|privatePlural$) Create($.type|private$ *$.type|raw$) (result *$.type|raw$, err error) {
result = &$.type|raw${}
err = c.client.Post().
Namespace(c.ns).
$if .namespaced$Namespace(c.ns).$end$
Resource("$.type|privatePlural$").
Body($.type|private$).
Do().
...
...
@@ -217,7 +258,7 @@ var updateTemplate = `
func (c *$.type|privatePlural$) Update($.type|private$ *$.type|raw$) (result *$.type|raw$, err error) {
result = &$.type|raw${}
err = c.client.Put().
Namespace(c.ns).
$if .namespaced$Namespace(c.ns).$end$
Resource("$.type|privatePlural$").
Name($.type|private$.Name).
Body($.type|private$).
...
...
@@ -240,7 +281,7 @@ var watchTemplate = `
func (c *$.type|privatePlural$) Watch(opts $.apiListOptions|raw$) ($.watchInterface|raw$, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).
$if .namespaced$Namespace(c.ns).$end$
Resource("$.type|privatePlural$").
VersionedParams(&opts, api.Scheme).
Watch()
...
...
cmd/libs/go2idl/client-gen/testoutput/testgroup/unversioned/testgroup_client.go
View file @
ec9771cc
...
...
@@ -23,7 +23,7 @@ import (
)
type
TestgroupInterface
interface
{
TestType
Namespac
er
TestType
sGett
er
}
// TestgroupClient is used to interact with features provided by the Testgroup group.
...
...
cmd/libs/go2idl/client-gen/testoutput/testgroup/unversioned/testtype.go
View file @
ec9771cc
...
...
@@ -22,8 +22,9 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// TestTypeNamespacer has methods to work with TestType resources in a namespace
type
TestTypeNamespacer
interface
{
// TestTypesGetter has a method to return a TestTypeInterface.
// A group's client should implement this interface.
type
TestTypesGetter
interface
{
TestTypes
(
namespace
string
)
TestTypeInterface
}
...
...
pkg/api/types.go
View file @
ec9771cc
...
...
@@ -261,7 +261,7 @@ type PersistentVolumeClaimVolumeSource struct {
ReadOnly
bool
`json:"readOnly,omitempty"`
}
// +genclient=true
// +genclient=true
,nonNamespaced=true
type
PersistentVolume
struct
{
unversioned
.
TypeMeta
`json:",inline"`
...
...
@@ -1629,7 +1629,7 @@ const (
// ResourceList is a set of (resource name, quantity) pairs.
type
ResourceList
map
[
ResourceName
]
resource
.
Quantity
// +genclient=true
// +genclient=true
,nonNamespaced=true
// Node is a worker node in Kubernetes
// The name of the node according to etcd is in ObjectMeta.Name.
...
...
@@ -1681,7 +1681,7 @@ const (
NamespaceTerminating
NamespacePhase
=
"Terminating"
)
// +genclient=true
// +genclient=true
,nonNamespaced=true
// A namespace provides a scope for Names.
// Use of multiple namespaces is optional
...
...
@@ -2174,7 +2174,7 @@ type ComponentCondition struct {
Error
string
`json:"error,omitempty"`
}
// +genclient=true
// +genclient=true
,nonNamespaced=true
// ComponentStatus (and ComponentStatusList) holds the cluster validation info.
type
ComponentStatus
struct
{
...
...
pkg/client/typed/generated/extensions/unversioned/daemonset.go
View file @
ec9771cc
...
...
@@ -22,8 +22,9 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// DaemonSetNamespacer has methods to work with DaemonSet resources in a namespace
type
DaemonSetNamespacer
interface
{
// DaemonSetsGetter has a method to return a DaemonSetInterface.
// A group's client should implement this interface.
type
DaemonSetsGetter
interface
{
DaemonSets
(
namespace
string
)
DaemonSetInterface
}
...
...
pkg/client/typed/generated/extensions/unversioned/deployment.go
View file @
ec9771cc
...
...
@@ -22,8 +22,9 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// DeploymentNamespacer has methods to work with Deployment resources in a namespace
type
DeploymentNamespacer
interface
{
// DeploymentsGetter has a method to return a DeploymentInterface.
// A group's client should implement this interface.
type
DeploymentsGetter
interface
{
Deployments
(
namespace
string
)
DeploymentInterface
}
...
...
pkg/client/typed/generated/extensions/unversioned/extensions_client.go
View file @
ec9771cc
...
...
@@ -23,12 +23,12 @@ import (
)
type
ExtensionsInterface
interface
{
DaemonSet
Namespac
er
Deployment
Namespac
er
HorizontalPodAutoscaler
Namespac
er
Ingress
Namespac
er
Job
Namespac
er
ThirdPartyResource
Namespac
er
DaemonSet
sGett
er
Deployment
sGett
er
HorizontalPodAutoscaler
sGett
er
Ingress
esGett
er
Job
sGett
er
ThirdPartyResource
sGett
er
}
// ExtensionsClient is used to interact with features provided by the Extensions group.
...
...
pkg/client/typed/generated/extensions/unversioned/horizontalpodautoscaler.go
View file @
ec9771cc
...
...
@@ -22,8 +22,9 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// HorizontalPodAutoscalerNamespacer has methods to work with HorizontalPodAutoscaler resources in a namespace
type
HorizontalPodAutoscalerNamespacer
interface
{
// HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface.
// A group's client should implement this interface.
type
HorizontalPodAutoscalersGetter
interface
{
HorizontalPodAutoscalers
(
namespace
string
)
HorizontalPodAutoscalerInterface
}
...
...
pkg/client/typed/generated/extensions/unversioned/ingress.go
View file @
ec9771cc
...
...
@@ -22,8 +22,9 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// IngressNamespacer has methods to work with Ingress resources in a namespace
type
IngressNamespacer
interface
{
// IngressesGetter has a method to return a IngressInterface.
// A group's client should implement this interface.
type
IngressesGetter
interface
{
Ingresses
(
namespace
string
)
IngressInterface
}
...
...
pkg/client/typed/generated/extensions/unversioned/job.go
View file @
ec9771cc
...
...
@@ -22,8 +22,9 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// JobNamespacer has methods to work with Job resources in a namespace
type
JobNamespacer
interface
{
// JobsGetter has a method to return a JobInterface.
// A group's client should implement this interface.
type
JobsGetter
interface
{
Jobs
(
namespace
string
)
JobInterface
}
...
...
pkg/client/typed/generated/extensions/unversioned/thirdpartyresource.go
View file @
ec9771cc
...
...
@@ -22,8 +22,9 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// ThirdPartyResourceNamespacer has methods to work with ThirdPartyResource resources in a namespace
type
ThirdPartyResourceNamespacer
interface
{
// ThirdPartyResourcesGetter has a method to return a ThirdPartyResourceInterface.
// A group's client should implement this interface.
type
ThirdPartyResourcesGetter
interface
{
ThirdPartyResources
(
namespace
string
)
ThirdPartyResourceInterface
}
...
...
pkg/client/typed/generated/legacy/unversioned/componentstatus.go
View file @
ec9771cc
...
...
@@ -21,9 +21,10 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// ComponentStatusNamespacer has methods to work with ComponentStatus resources in a namespace
type
ComponentStatusNamespacer
interface
{
ComponentStatus
(
namespace
string
)
ComponentStatusInterface
// ComponentStatusGetter has a method to return a ComponentStatusInterface.
// A group's client should implement this interface.
type
ComponentStatusGetter
interface
{
ComponentStatus
()
ComponentStatusInterface
}
// ComponentStatusInterface has methods to work with ComponentStatus resources.
...
...
@@ -41,14 +42,12 @@ type ComponentStatusInterface interface {
// componentStatus implements ComponentStatusInterface
type
componentStatus
struct
{
client
*
LegacyClient
ns
string
}
// newComponentStatus returns a ComponentStatus
func
newComponentStatus
(
c
*
LegacyClient
,
namespace
string
)
*
componentStatus
{
func
newComponentStatus
(
c
*
LegacyClient
)
*
componentStatus
{
return
&
componentStatus
{
client
:
c
,
ns
:
namespace
,
}
}
...
...
@@ -56,7 +55,6 @@ func newComponentStatus(c *LegacyClient, namespace string) *componentStatus {
func
(
c
*
componentStatus
)
Create
(
componentStatus
*
api
.
ComponentStatus
)
(
result
*
api
.
ComponentStatus
,
err
error
)
{
result
=
&
api
.
ComponentStatus
{}
err
=
c
.
client
.
Post
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"componentStatus"
)
.
Body
(
componentStatus
)
.
Do
()
.
...
...
@@ -68,7 +66,6 @@ func (c *componentStatus) Create(componentStatus *api.ComponentStatus) (result *
func
(
c
*
componentStatus
)
Update
(
componentStatus
*
api
.
ComponentStatus
)
(
result
*
api
.
ComponentStatus
,
err
error
)
{
result
=
&
api
.
ComponentStatus
{}
err
=
c
.
client
.
Put
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"componentStatus"
)
.
Name
(
componentStatus
.
Name
)
.
Body
(
componentStatus
)
.
...
...
@@ -80,7 +77,6 @@ func (c *componentStatus) Update(componentStatus *api.ComponentStatus) (result *
// Delete takes name of the componentStatus and deletes it. Returns an error if one occurs.
func
(
c
*
componentStatus
)
Delete
(
name
string
,
options
*
api
.
DeleteOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"componentStatus"
)
.
Name
(
name
)
.
Body
(
options
)
.
...
...
@@ -91,7 +87,6 @@ func (c *componentStatus) Delete(name string, options *api.DeleteOptions) error
// DeleteCollection deletes a collection of objects.
func
(
c
*
componentStatus
)
DeleteCollection
(
options
*
api
.
DeleteOptions
,
listOptions
api
.
ListOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"componentStatus"
)
.
VersionedParams
(
&
listOptions
,
api
.
Scheme
)
.
Body
(
options
)
.
...
...
@@ -103,7 +98,6 @@ func (c *componentStatus) DeleteCollection(options *api.DeleteOptions, listOptio
func
(
c
*
componentStatus
)
Get
(
name
string
)
(
result
*
api
.
ComponentStatus
,
err
error
)
{
result
=
&
api
.
ComponentStatus
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"componentStatus"
)
.
Name
(
name
)
.
Do
()
.
...
...
@@ -115,7 +109,6 @@ func (c *componentStatus) Get(name string) (result *api.ComponentStatus, err err
func
(
c
*
componentStatus
)
List
(
opts
api
.
ListOptions
)
(
result
*
api
.
ComponentStatusList
,
err
error
)
{
result
=
&
api
.
ComponentStatusList
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"componentStatus"
)
.
VersionedParams
(
&
opts
,
api
.
Scheme
)
.
Do
()
.
...
...
@@ -127,7 +120,6 @@ func (c *componentStatus) List(opts api.ListOptions) (result *api.ComponentStatu
func
(
c
*
componentStatus
)
Watch
(
opts
api
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
client
.
Get
()
.
Prefix
(
"watch"
)
.
Namespace
(
c
.
ns
)
.
Resource
(
"componentStatus"
)
.
VersionedParams
(
&
opts
,
api
.
Scheme
)
.
Watch
()
...
...
pkg/client/typed/generated/legacy/unversioned/endpoints.go
View file @
ec9771cc
...
...
@@ -21,8 +21,9 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// EndpointsNamespacer has methods to work with Endpoints resources in a namespace
type
EndpointsNamespacer
interface
{
// EndpointsGetter has a method to return a EndpointsInterface.
// A group's client should implement this interface.
type
EndpointsGetter
interface
{
Endpoints
(
namespace
string
)
EndpointsInterface
}
...
...
pkg/client/typed/generated/legacy/unversioned/event.go
View file @
ec9771cc
...
...
@@ -21,8 +21,9 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// EventNamespacer has methods to work with Event resources in a namespace
type
EventNamespacer
interface
{
// EventsGetter has a method to return a EventInterface.
// A group's client should implement this interface.
type
EventsGetter
interface
{
Events
(
namespace
string
)
EventInterface
}
...
...
pkg/client/typed/generated/legacy/unversioned/legacy_client.go
View file @
ec9771cc
...
...
@@ -23,21 +23,21 @@ import (
)
type
LegacyInterface
interface
{
ComponentStatus
Namespac
er
Endpoints
Namespac
er
Event
Namespac
er
LimitRange
Namespac
er
Namespace
Namespac
er
Node
Namespac
er
PersistentVolume
Namespac
er
PersistentVolumeClaim
Namespac
er
Pod
Namespac
er
PodTemplate
Namespac
er
ReplicationController
Namespac
er
ResourceQuota
Namespac
er
Secret
Namespac
er
Service
Namespac
er
ServiceAccount
Namespac
er
ComponentStatus
Gett
er
Endpoints
Gett
er
Event
sGett
er
LimitRange
sGett
er
Namespace
sGett
er
Node
sGett
er
PersistentVolume
sGett
er
PersistentVolumeClaim
sGett
er
Pod
sGett
er
PodTemplate
sGett
er
ReplicationController
sGett
er
ResourceQuota
sGett
er
Secret
sGett
er
Service
sGett
er
ServiceAccount
sGett
er
}
// LegacyClient is used to interact with features provided by the Legacy group.
...
...
@@ -45,8 +45,8 @@ type LegacyClient struct {
*
unversioned
.
RESTClient
}
func
(
c
*
LegacyClient
)
ComponentStatus
(
namespace
string
)
ComponentStatusInterface
{
return
newComponentStatus
(
c
,
namespace
)
func
(
c
*
LegacyClient
)
ComponentStatus
()
ComponentStatusInterface
{
return
newComponentStatus
(
c
)
}
func
(
c
*
LegacyClient
)
Endpoints
(
namespace
string
)
EndpointsInterface
{
...
...
@@ -61,16 +61,16 @@ func (c *LegacyClient) LimitRanges(namespace string) LimitRangeInterface {
return
newLimitRanges
(
c
,
namespace
)
}
func
(
c
*
LegacyClient
)
Namespaces
(
namespace
string
)
NamespaceInterface
{
return
newNamespaces
(
c
,
namespace
)
func
(
c
*
LegacyClient
)
Namespaces
()
NamespaceInterface
{
return
newNamespaces
(
c
)
}
func
(
c
*
LegacyClient
)
Nodes
(
namespace
string
)
NodeInterface
{
return
newNodes
(
c
,
namespace
)
func
(
c
*
LegacyClient
)
Nodes
()
NodeInterface
{
return
newNodes
(
c
)
}
func
(
c
*
LegacyClient
)
PersistentVolumes
(
namespace
string
)
PersistentVolumeInterface
{
return
newPersistentVolumes
(
c
,
namespace
)
func
(
c
*
LegacyClient
)
PersistentVolumes
()
PersistentVolumeInterface
{
return
newPersistentVolumes
(
c
)
}
func
(
c
*
LegacyClient
)
PersistentVolumeClaims
(
namespace
string
)
PersistentVolumeClaimInterface
{
...
...
pkg/client/typed/generated/legacy/unversioned/limitrange.go
View file @
ec9771cc
...
...
@@ -21,8 +21,9 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// LimitRangeNamespacer has methods to work with LimitRange resources in a namespace
type
LimitRangeNamespacer
interface
{
// LimitRangesGetter has a method to return a LimitRangeInterface.
// A group's client should implement this interface.
type
LimitRangesGetter
interface
{
LimitRanges
(
namespace
string
)
LimitRangeInterface
}
...
...
pkg/client/typed/generated/legacy/unversioned/namespace.go
View file @
ec9771cc
...
...
@@ -21,9 +21,10 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// NamespaceNamespacer has methods to work with Namespace resources in a namespace
type
NamespaceNamespacer
interface
{
Namespaces
(
namespace
string
)
NamespaceInterface
// NamespacesGetter has a method to return a NamespaceInterface.
// A group's client should implement this interface.
type
NamespacesGetter
interface
{
Namespaces
()
NamespaceInterface
}
// NamespaceInterface has methods to work with Namespace resources.
...
...
@@ -42,14 +43,12 @@ type NamespaceInterface interface {
// namespaces implements NamespaceInterface
type
namespaces
struct
{
client
*
LegacyClient
ns
string
}
// newNamespaces returns a Namespaces
func
newNamespaces
(
c
*
LegacyClient
,
namespace
string
)
*
namespaces
{
func
newNamespaces
(
c
*
LegacyClient
)
*
namespaces
{
return
&
namespaces
{
client
:
c
,
ns
:
namespace
,
}
}
...
...
@@ -57,7 +56,6 @@ func newNamespaces(c *LegacyClient, namespace string) *namespaces {
func
(
c
*
namespaces
)
Create
(
namespace
*
api
.
Namespace
)
(
result
*
api
.
Namespace
,
err
error
)
{
result
=
&
api
.
Namespace
{}
err
=
c
.
client
.
Post
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"namespaces"
)
.
Body
(
namespace
)
.
Do
()
.
...
...
@@ -69,7 +67,6 @@ func (c *namespaces) Create(namespace *api.Namespace) (result *api.Namespace, er
func
(
c
*
namespaces
)
Update
(
namespace
*
api
.
Namespace
)
(
result
*
api
.
Namespace
,
err
error
)
{
result
=
&
api
.
Namespace
{}
err
=
c
.
client
.
Put
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"namespaces"
)
.
Name
(
namespace
.
Name
)
.
Body
(
namespace
)
.
...
...
@@ -87,7 +84,6 @@ func (c *namespaces) UpdateStatus(namespace *api.Namespace) (*api.Namespace, err
// Delete takes name of the namespace and deletes it. Returns an error if one occurs.
func
(
c
*
namespaces
)
Delete
(
name
string
,
options
*
api
.
DeleteOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"namespaces"
)
.
Name
(
name
)
.
Body
(
options
)
.
...
...
@@ -98,7 +94,6 @@ func (c *namespaces) Delete(name string, options *api.DeleteOptions) error {
// DeleteCollection deletes a collection of objects.
func
(
c
*
namespaces
)
DeleteCollection
(
options
*
api
.
DeleteOptions
,
listOptions
api
.
ListOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"namespaces"
)
.
VersionedParams
(
&
listOptions
,
api
.
Scheme
)
.
Body
(
options
)
.
...
...
@@ -110,7 +105,6 @@ func (c *namespaces) DeleteCollection(options *api.DeleteOptions, listOptions ap
func
(
c
*
namespaces
)
Get
(
name
string
)
(
result
*
api
.
Namespace
,
err
error
)
{
result
=
&
api
.
Namespace
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"namespaces"
)
.
Name
(
name
)
.
Do
()
.
...
...
@@ -122,7 +116,6 @@ func (c *namespaces) Get(name string) (result *api.Namespace, err error) {
func
(
c
*
namespaces
)
List
(
opts
api
.
ListOptions
)
(
result
*
api
.
NamespaceList
,
err
error
)
{
result
=
&
api
.
NamespaceList
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"namespaces"
)
.
VersionedParams
(
&
opts
,
api
.
Scheme
)
.
Do
()
.
...
...
@@ -134,7 +127,6 @@ func (c *namespaces) List(opts api.ListOptions) (result *api.NamespaceList, err
func
(
c
*
namespaces
)
Watch
(
opts
api
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
client
.
Get
()
.
Prefix
(
"watch"
)
.
Namespace
(
c
.
ns
)
.
Resource
(
"namespaces"
)
.
VersionedParams
(
&
opts
,
api
.
Scheme
)
.
Watch
()
...
...
pkg/client/typed/generated/legacy/unversioned/node.go
View file @
ec9771cc
...
...
@@ -21,9 +21,10 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// NodeNamespacer has methods to work with Node resources in a namespace
type
NodeNamespacer
interface
{
Nodes
(
namespace
string
)
NodeInterface
// NodesGetter has a method to return a NodeInterface.
// A group's client should implement this interface.
type
NodesGetter
interface
{
Nodes
()
NodeInterface
}
// NodeInterface has methods to work with Node resources.
...
...
@@ -42,14 +43,12 @@ type NodeInterface interface {
// nodes implements NodeInterface
type
nodes
struct
{
client
*
LegacyClient
ns
string
}
// newNodes returns a Nodes
func
newNodes
(
c
*
LegacyClient
,
namespace
string
)
*
nodes
{
func
newNodes
(
c
*
LegacyClient
)
*
nodes
{
return
&
nodes
{
client
:
c
,
ns
:
namespace
,
}
}
...
...
@@ -57,7 +56,6 @@ func newNodes(c *LegacyClient, namespace string) *nodes {
func
(
c
*
nodes
)
Create
(
node
*
api
.
Node
)
(
result
*
api
.
Node
,
err
error
)
{
result
=
&
api
.
Node
{}
err
=
c
.
client
.
Post
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"nodes"
)
.
Body
(
node
)
.
Do
()
.
...
...
@@ -69,7 +67,6 @@ func (c *nodes) Create(node *api.Node) (result *api.Node, err error) {
func
(
c
*
nodes
)
Update
(
node
*
api
.
Node
)
(
result
*
api
.
Node
,
err
error
)
{
result
=
&
api
.
Node
{}
err
=
c
.
client
.
Put
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"nodes"
)
.
Name
(
node
.
Name
)
.
Body
(
node
)
.
...
...
@@ -87,7 +84,6 @@ func (c *nodes) UpdateStatus(node *api.Node) (*api.Node, error) {
// Delete takes name of the node and deletes it. Returns an error if one occurs.
func
(
c
*
nodes
)
Delete
(
name
string
,
options
*
api
.
DeleteOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"nodes"
)
.
Name
(
name
)
.
Body
(
options
)
.
...
...
@@ -98,7 +94,6 @@ func (c *nodes) Delete(name string, options *api.DeleteOptions) error {
// DeleteCollection deletes a collection of objects.
func
(
c
*
nodes
)
DeleteCollection
(
options
*
api
.
DeleteOptions
,
listOptions
api
.
ListOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"nodes"
)
.
VersionedParams
(
&
listOptions
,
api
.
Scheme
)
.
Body
(
options
)
.
...
...
@@ -110,7 +105,6 @@ func (c *nodes) DeleteCollection(options *api.DeleteOptions, listOptions api.Lis
func
(
c
*
nodes
)
Get
(
name
string
)
(
result
*
api
.
Node
,
err
error
)
{
result
=
&
api
.
Node
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"nodes"
)
.
Name
(
name
)
.
Do
()
.
...
...
@@ -122,7 +116,6 @@ func (c *nodes) Get(name string) (result *api.Node, err error) {
func
(
c
*
nodes
)
List
(
opts
api
.
ListOptions
)
(
result
*
api
.
NodeList
,
err
error
)
{
result
=
&
api
.
NodeList
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"nodes"
)
.
VersionedParams
(
&
opts
,
api
.
Scheme
)
.
Do
()
.
...
...
@@ -134,7 +127,6 @@ func (c *nodes) List(opts api.ListOptions) (result *api.NodeList, err error) {
func
(
c
*
nodes
)
Watch
(
opts
api
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
client
.
Get
()
.
Prefix
(
"watch"
)
.
Namespace
(
c
.
ns
)
.
Resource
(
"nodes"
)
.
VersionedParams
(
&
opts
,
api
.
Scheme
)
.
Watch
()
...
...
pkg/client/typed/generated/legacy/unversioned/persistentvolume.go
View file @
ec9771cc
...
...
@@ -21,9 +21,10 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// PersistentVolumeNamespacer has methods to work with PersistentVolume resources in a namespace
type
PersistentVolumeNamespacer
interface
{
PersistentVolumes
(
namespace
string
)
PersistentVolumeInterface
// PersistentVolumesGetter has a method to return a PersistentVolumeInterface.
// A group's client should implement this interface.
type
PersistentVolumesGetter
interface
{
PersistentVolumes
()
PersistentVolumeInterface
}
// PersistentVolumeInterface has methods to work with PersistentVolume resources.
...
...
@@ -42,14 +43,12 @@ type PersistentVolumeInterface interface {
// persistentVolumes implements PersistentVolumeInterface
type
persistentVolumes
struct
{
client
*
LegacyClient
ns
string
}
// newPersistentVolumes returns a PersistentVolumes
func
newPersistentVolumes
(
c
*
LegacyClient
,
namespace
string
)
*
persistentVolumes
{
func
newPersistentVolumes
(
c
*
LegacyClient
)
*
persistentVolumes
{
return
&
persistentVolumes
{
client
:
c
,
ns
:
namespace
,
}
}
...
...
@@ -57,7 +56,6 @@ func newPersistentVolumes(c *LegacyClient, namespace string) *persistentVolumes
func
(
c
*
persistentVolumes
)
Create
(
persistentVolume
*
api
.
PersistentVolume
)
(
result
*
api
.
PersistentVolume
,
err
error
)
{
result
=
&
api
.
PersistentVolume
{}
err
=
c
.
client
.
Post
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"persistentVolumes"
)
.
Body
(
persistentVolume
)
.
Do
()
.
...
...
@@ -69,7 +67,6 @@ func (c *persistentVolumes) Create(persistentVolume *api.PersistentVolume) (resu
func
(
c
*
persistentVolumes
)
Update
(
persistentVolume
*
api
.
PersistentVolume
)
(
result
*
api
.
PersistentVolume
,
err
error
)
{
result
=
&
api
.
PersistentVolume
{}
err
=
c
.
client
.
Put
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"persistentVolumes"
)
.
Name
(
persistentVolume
.
Name
)
.
Body
(
persistentVolume
)
.
...
...
@@ -87,7 +84,6 @@ func (c *persistentVolumes) UpdateStatus(persistentVolume *api.PersistentVolume)
// Delete takes name of the persistentVolume and deletes it. Returns an error if one occurs.
func
(
c
*
persistentVolumes
)
Delete
(
name
string
,
options
*
api
.
DeleteOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"persistentVolumes"
)
.
Name
(
name
)
.
Body
(
options
)
.
...
...
@@ -98,7 +94,6 @@ func (c *persistentVolumes) Delete(name string, options *api.DeleteOptions) erro
// DeleteCollection deletes a collection of objects.
func
(
c
*
persistentVolumes
)
DeleteCollection
(
options
*
api
.
DeleteOptions
,
listOptions
api
.
ListOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"persistentVolumes"
)
.
VersionedParams
(
&
listOptions
,
api
.
Scheme
)
.
Body
(
options
)
.
...
...
@@ -110,7 +105,6 @@ func (c *persistentVolumes) DeleteCollection(options *api.DeleteOptions, listOpt
func
(
c
*
persistentVolumes
)
Get
(
name
string
)
(
result
*
api
.
PersistentVolume
,
err
error
)
{
result
=
&
api
.
PersistentVolume
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"persistentVolumes"
)
.
Name
(
name
)
.
Do
()
.
...
...
@@ -122,7 +116,6 @@ func (c *persistentVolumes) Get(name string) (result *api.PersistentVolume, err
func
(
c
*
persistentVolumes
)
List
(
opts
api
.
ListOptions
)
(
result
*
api
.
PersistentVolumeList
,
err
error
)
{
result
=
&
api
.
PersistentVolumeList
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"persistentVolumes"
)
.
VersionedParams
(
&
opts
,
api
.
Scheme
)
.
Do
()
.
...
...
@@ -134,7 +127,6 @@ func (c *persistentVolumes) List(opts api.ListOptions) (result *api.PersistentVo
func
(
c
*
persistentVolumes
)
Watch
(
opts
api
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
client
.
Get
()
.
Prefix
(
"watch"
)
.
Namespace
(
c
.
ns
)
.
Resource
(
"persistentVolumes"
)
.
VersionedParams
(
&
opts
,
api
.
Scheme
)
.
Watch
()
...
...
pkg/client/typed/generated/legacy/unversioned/persistentvolumeclaim.go
View file @
ec9771cc
...
...
@@ -21,8 +21,9 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// PersistentVolumeClaimNamespacer has methods to work with PersistentVolumeClaim resources in a namespace
type
PersistentVolumeClaimNamespacer
interface
{
// PersistentVolumeClaimsGetter has a method to return a PersistentVolumeClaimInterface.
// A group's client should implement this interface.
type
PersistentVolumeClaimsGetter
interface
{
PersistentVolumeClaims
(
namespace
string
)
PersistentVolumeClaimInterface
}
...
...
pkg/client/typed/generated/legacy/unversioned/pod.go
View file @
ec9771cc
...
...
@@ -21,8 +21,9 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// PodNamespacer has methods to work with Pod resources in a namespace
type
PodNamespacer
interface
{
// PodsGetter has a method to return a PodInterface.
// A group's client should implement this interface.
type
PodsGetter
interface
{
Pods
(
namespace
string
)
PodInterface
}
...
...
pkg/client/typed/generated/legacy/unversioned/podtemplate.go
View file @
ec9771cc
...
...
@@ -21,8 +21,9 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// PodTemplateNamespacer has methods to work with PodTemplate resources in a namespace
type
PodTemplateNamespacer
interface
{
// PodTemplatesGetter has a method to return a PodTemplateInterface.
// A group's client should implement this interface.
type
PodTemplatesGetter
interface
{
PodTemplates
(
namespace
string
)
PodTemplateInterface
}
...
...
pkg/client/typed/generated/legacy/unversioned/replicationcontroller.go
View file @
ec9771cc
...
...
@@ -21,8 +21,9 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// ReplicationControllerNamespacer has methods to work with ReplicationController resources in a namespace
type
ReplicationControllerNamespacer
interface
{
// ReplicationControllersGetter has a method to return a ReplicationControllerInterface.
// A group's client should implement this interface.
type
ReplicationControllersGetter
interface
{
ReplicationControllers
(
namespace
string
)
ReplicationControllerInterface
}
...
...
pkg/client/typed/generated/legacy/unversioned/resourcequota.go
View file @
ec9771cc
...
...
@@ -21,8 +21,9 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// ResourceQuotaNamespacer has methods to work with ResourceQuota resources in a namespace
type
ResourceQuotaNamespacer
interface
{
// ResourceQuotasGetter has a method to return a ResourceQuotaInterface.
// A group's client should implement this interface.
type
ResourceQuotasGetter
interface
{
ResourceQuotas
(
namespace
string
)
ResourceQuotaInterface
}
...
...
pkg/client/typed/generated/legacy/unversioned/secret.go
View file @
ec9771cc
...
...
@@ -21,8 +21,9 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// SecretNamespacer has methods to work with Secret resources in a namespace
type
SecretNamespacer
interface
{
// SecretsGetter has a method to return a SecretInterface.
// A group's client should implement this interface.
type
SecretsGetter
interface
{
Secrets
(
namespace
string
)
SecretInterface
}
...
...
pkg/client/typed/generated/legacy/unversioned/service.go
View file @
ec9771cc
...
...
@@ -21,8 +21,9 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// ServiceNamespacer has methods to work with Service resources in a namespace
type
ServiceNamespacer
interface
{
// ServicesGetter has a method to return a ServiceInterface.
// A group's client should implement this interface.
type
ServicesGetter
interface
{
Services
(
namespace
string
)
ServiceInterface
}
...
...
pkg/client/typed/generated/legacy/unversioned/serviceaccount.go
View file @
ec9771cc
...
...
@@ -21,8 +21,9 @@ import (
watch
"k8s.io/kubernetes/pkg/watch"
)
// ServiceAccountNamespacer has methods to work with ServiceAccount resources in a namespace
type
ServiceAccountNamespacer
interface
{
// ServiceAccountsGetter has a method to return a ServiceAccountInterface.
// A group's client should implement this interface.
type
ServiceAccountsGetter
interface
{
ServiceAccounts
(
namespace
string
)
ServiceAccountInterface
}
...
...
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