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
e41d5047
Commit
e41d5047
authored
Apr 30, 2016
by
Jordan Liggitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move ThirdPartyResource to root scoped object
parent
ee2a0694
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
89 additions
and
134 deletions
+89
-134
extensions_v1beta1.json
api/swagger-spec/extensions_v1beta1.json
+0
-0
operations.html
docs/api-reference/extensions/v1beta1/operations.html
+0
-0
install.go
pkg/apis/extensions/install/install.go
+1
-0
types.go
pkg/apis/extensions/types.go
+1
-1
types.go
pkg/apis/extensions/v1beta1/types.go
+1
-1
validation.go
pkg/apis/extensions/validation/validation.go
+1
-1
extensions_client.go
...ientset/typed/extensions/unversioned/extensions_client.go
+2
-2
fake_extensions_client.go
...ped/extensions/unversioned/fake/fake_extensions_client.go
+2
-2
fake_thirdpartyresource.go
...ed/extensions/unversioned/fake/fake_thirdpartyresource.go
+7
-14
thirdpartyresource.go
...entset/typed/extensions/unversioned/thirdpartyresource.go
+2
-11
extensions_client.go
...release_1_2/typed/extensions/v1beta1/extensions_client.go
+2
-2
fake_extensions_client.go
...2/typed/extensions/v1beta1/fake/fake_extensions_client.go
+2
-2
fake_thirdpartyresource.go
.../typed/extensions/v1beta1/fake/fake_thirdpartyresource.go
+7
-8
thirdpartyresource.go
...elease_1_2/typed/extensions/v1beta1/thirdpartyresource.go
+2
-11
extensions_client.go
...release_1_3/typed/extensions/v1beta1/extensions_client.go
+2
-2
fake_extensions_client.go
...3/typed/extensions/v1beta1/fake/fake_extensions_client.go
+2
-2
fake_thirdpartyresource.go
.../typed/extensions/v1beta1/fake/fake_thirdpartyresource.go
+7
-8
thirdpartyresource.go
...elease_1_3/typed/extensions/v1beta1/thirdpartyresource.go
+2
-10
extensions.go
pkg/client/unversioned/extensions.go
+2
-2
fake_thirdpartyresources.go
...client/unversioned/testclient/fake_thirdpartyresources.go
+8
-9
testclient.go
pkg/client/unversioned/testclient/testclient.go
+2
-2
thirdpartyresources.go
pkg/client/unversioned/thirdpartyresources.go
+10
-12
thirdpartyresources_test.go
pkg/client/unversioned/thirdpartyresources_test.go
+13
-20
etcd.go
pkg/registry/thirdpartyresource/etcd/etcd.go
+2
-2
etcd_test.go
pkg/registry/thirdpartyresource/etcd/etcd_test.go
+8
-9
strategy.go
pkg/registry/thirdpartyresource/strategy.go
+1
-1
No files found.
api/swagger-spec/extensions_v1beta1.json
View file @
e41d5047
This diff is collapsed.
Click to expand it.
docs/api-reference/extensions/v1beta1/operations.html
View file @
e41d5047
This diff is collapsed.
Click to expand it.
pkg/apis/extensions/install/install.go
View file @
e41d5047
...
...
@@ -92,6 +92,7 @@ func newRESTMapper(externalVersions []unversioned.GroupVersion) meta.RESTMapper
// if a kind is not enumerated here, it is assumed to have a namespace scope
rootScoped
:=
sets
.
NewString
(
"PodSecurityPolicy"
,
"ThirdPartyResource"
,
)
ignoredKinds
:=
sets
.
NewString
()
...
...
pkg/apis/extensions/types.go
View file @
e41d5047
...
...
@@ -169,7 +169,7 @@ type HorizontalPodAutoscalerList struct {
Items
[]
HorizontalPodAutoscaler
`json:"items"`
}
// +genclient=true
// +genclient=true
,nonNamespaced=true
// A ThirdPartyResource is a generic representation of a resource, it is used by add-ons and plugins to add new resource
// types to the API. It consists of one or more Versions of the api.
...
...
pkg/apis/extensions/v1beta1/types.go
View file @
e41d5047
...
...
@@ -166,7 +166,7 @@ type HorizontalPodAutoscalerList struct {
Items
[]
HorizontalPodAutoscaler
`json:"items" protobuf:"bytes,2,rep,name=items"`
}
// +genclient=true
// +genclient=true
,nonNamespaced=true
// A ThirdPartyResource is a generic representation of a resource, it is used by add-ons and plugins to add new resource
// types to the API. It consists of one or more Versions of the api.
...
...
pkg/apis/extensions/validation/validation.go
View file @
e41d5047
...
...
@@ -145,7 +145,7 @@ func ValidateThirdPartyResourceName(name string, prefix bool) (bool, string) {
func
ValidateThirdPartyResource
(
obj
*
extensions
.
ThirdPartyResource
)
field
.
ErrorList
{
allErrs
:=
field
.
ErrorList
{}
allErrs
=
append
(
allErrs
,
apivalidation
.
ValidateObjectMeta
(
&
obj
.
ObjectMeta
,
tru
e
,
ValidateThirdPartyResourceName
,
field
.
NewPath
(
"metadata"
))
...
)
allErrs
=
append
(
allErrs
,
apivalidation
.
ValidateObjectMeta
(
&
obj
.
ObjectMeta
,
fals
e
,
ValidateThirdPartyResourceName
,
field
.
NewPath
(
"metadata"
))
...
)
versions
:=
sets
.
String
{}
for
ix
:=
range
obj
.
Versions
{
...
...
pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/extensions_client.go
View file @
e41d5047
...
...
@@ -62,8 +62,8 @@ func (c *ExtensionsClient) Scales(namespace string) ScaleInterface {
return
newScales
(
c
,
namespace
)
}
func
(
c
*
ExtensionsClient
)
ThirdPartyResources
(
namespace
string
)
ThirdPartyResourceInterface
{
return
newThirdPartyResources
(
c
,
namespace
)
func
(
c
*
ExtensionsClient
)
ThirdPartyResources
()
ThirdPartyResourceInterface
{
return
newThirdPartyResources
(
c
)
}
// NewForConfig creates a new ExtensionsClient for the given config.
...
...
pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/fake/fake_extensions_client.go
View file @
e41d5047
...
...
@@ -50,8 +50,8 @@ func (c *FakeExtensions) Scales(namespace string) unversioned.ScaleInterface {
return
&
FakeScales
{
c
,
namespace
}
}
func
(
c
*
FakeExtensions
)
ThirdPartyResources
(
namespace
string
)
unversioned
.
ThirdPartyResourceInterface
{
return
&
FakeThirdPartyResources
{
c
,
namespace
}
func
(
c
*
FakeExtensions
)
ThirdPartyResources
()
unversioned
.
ThirdPartyResourceInterface
{
return
&
FakeThirdPartyResources
{
c
}
}
// GetRESTClient returns a RESTClient that is used to communicate
...
...
pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/fake/fake_thirdpartyresource.go
View file @
e41d5047
...
...
@@ -28,15 +28,13 @@ import (
// FakeThirdPartyResources implements ThirdPartyResourceInterface
type
FakeThirdPartyResources
struct
{
Fake
*
FakeExtensions
ns
string
}
var
thirdpartyresourcesResource
=
unversioned
.
GroupVersionResource
{
Group
:
"extensions"
,
Version
:
""
,
Resource
:
"thirdpartyresources"
}
func
(
c
*
FakeThirdPartyResources
)
Create
(
thirdPartyResource
*
extensions
.
ThirdPartyResource
)
(
result
*
extensions
.
ThirdPartyResource
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
core
.
NewCreateAction
(
thirdpartyresourcesResource
,
c
.
ns
,
thirdPartyResource
),
&
extensions
.
ThirdPartyResource
{})
Invokes
(
core
.
NewRootCreateAction
(
thirdpartyresourcesResource
,
thirdPartyResource
),
&
extensions
.
ThirdPartyResource
{})
if
obj
==
nil
{
return
nil
,
err
}
...
...
@@ -45,8 +43,7 @@ func (c *FakeThirdPartyResources) Create(thirdPartyResource *extensions.ThirdPar
func
(
c
*
FakeThirdPartyResources
)
Update
(
thirdPartyResource
*
extensions
.
ThirdPartyResource
)
(
result
*
extensions
.
ThirdPartyResource
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
core
.
NewUpdateAction
(
thirdpartyresourcesResource
,
c
.
ns
,
thirdPartyResource
),
&
extensions
.
ThirdPartyResource
{})
Invokes
(
core
.
NewRootUpdateAction
(
thirdpartyresourcesResource
,
thirdPartyResource
),
&
extensions
.
ThirdPartyResource
{})
if
obj
==
nil
{
return
nil
,
err
}
...
...
@@ -55,13 +52,12 @@ func (c *FakeThirdPartyResources) Update(thirdPartyResource *extensions.ThirdPar
func
(
c
*
FakeThirdPartyResources
)
Delete
(
name
string
,
options
*
api
.
DeleteOptions
)
error
{
_
,
err
:=
c
.
Fake
.
Invokes
(
core
.
NewDeleteAction
(
thirdpartyresourcesResource
,
c
.
ns
,
name
),
&
extensions
.
ThirdPartyResource
{})
Invokes
(
core
.
NewRootDeleteAction
(
thirdpartyresourcesResource
,
name
),
&
extensions
.
ThirdPartyResource
{})
return
err
}
func
(
c
*
FakeThirdPartyResources
)
DeleteCollection
(
options
*
api
.
DeleteOptions
,
listOptions
api
.
ListOptions
)
error
{
action
:=
core
.
New
DeleteCollectionAction
(
thirdpartyresourcesResource
,
c
.
ns
,
listOptions
)
action
:=
core
.
New
RootDeleteCollectionAction
(
thirdpartyresourcesResource
,
listOptions
)
_
,
err
:=
c
.
Fake
.
Invokes
(
action
,
&
extensions
.
ThirdPartyResourceList
{})
return
err
...
...
@@ -69,8 +65,7 @@ func (c *FakeThirdPartyResources) DeleteCollection(options *api.DeleteOptions, l
func
(
c
*
FakeThirdPartyResources
)
Get
(
name
string
)
(
result
*
extensions
.
ThirdPartyResource
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
core
.
NewGetAction
(
thirdpartyresourcesResource
,
c
.
ns
,
name
),
&
extensions
.
ThirdPartyResource
{})
Invokes
(
core
.
NewRootGetAction
(
thirdpartyresourcesResource
,
name
),
&
extensions
.
ThirdPartyResource
{})
if
obj
==
nil
{
return
nil
,
err
}
...
...
@@ -79,8 +74,7 @@ func (c *FakeThirdPartyResources) Get(name string) (result *extensions.ThirdPart
func
(
c
*
FakeThirdPartyResources
)
List
(
opts
api
.
ListOptions
)
(
result
*
extensions
.
ThirdPartyResourceList
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
core
.
NewListAction
(
thirdpartyresourcesResource
,
c
.
ns
,
opts
),
&
extensions
.
ThirdPartyResourceList
{})
Invokes
(
core
.
NewRootListAction
(
thirdpartyresourcesResource
,
opts
),
&
extensions
.
ThirdPartyResourceList
{})
if
obj
==
nil
{
return
nil
,
err
}
...
...
@@ -101,6 +95,5 @@ func (c *FakeThirdPartyResources) List(opts api.ListOptions) (result *extensions
// Watch returns a watch.Interface that watches the requested thirdPartyResources.
func
(
c
*
FakeThirdPartyResources
)
Watch
(
opts
api
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
Fake
.
InvokesWatch
(
core
.
NewWatchAction
(
thirdpartyresourcesResource
,
c
.
ns
,
opts
))
InvokesWatch
(
core
.
NewRootWatchAction
(
thirdpartyresourcesResource
,
opts
))
}
pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/thirdpartyresource.go
View file @
e41d5047
...
...
@@ -25,7 +25,7 @@ import (
// ThirdPartyResourcesGetter has a method to return a ThirdPartyResourceInterface.
// A group's client should implement this interface.
type
ThirdPartyResourcesGetter
interface
{
ThirdPartyResources
(
namespace
string
)
ThirdPartyResourceInterface
ThirdPartyResources
()
ThirdPartyResourceInterface
}
// ThirdPartyResourceInterface has methods to work with ThirdPartyResource resources.
...
...
@@ -43,14 +43,12 @@ type ThirdPartyResourceInterface interface {
// thirdPartyResources implements ThirdPartyResourceInterface
type
thirdPartyResources
struct
{
client
*
ExtensionsClient
ns
string
}
// newThirdPartyResources returns a ThirdPartyResources
func
newThirdPartyResources
(
c
*
ExtensionsClient
,
namespace
string
)
*
thirdPartyResources
{
func
newThirdPartyResources
(
c
*
ExtensionsClient
)
*
thirdPartyResources
{
return
&
thirdPartyResources
{
client
:
c
,
ns
:
namespace
,
}
}
...
...
@@ -58,7 +56,6 @@ func newThirdPartyResources(c *ExtensionsClient, namespace string) *thirdPartyRe
func
(
c
*
thirdPartyResources
)
Create
(
thirdPartyResource
*
extensions
.
ThirdPartyResource
)
(
result
*
extensions
.
ThirdPartyResource
,
err
error
)
{
result
=
&
extensions
.
ThirdPartyResource
{}
err
=
c
.
client
.
Post
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
Body
(
thirdPartyResource
)
.
Do
()
.
...
...
@@ -70,7 +67,6 @@ func (c *thirdPartyResources) Create(thirdPartyResource *extensions.ThirdPartyRe
func
(
c
*
thirdPartyResources
)
Update
(
thirdPartyResource
*
extensions
.
ThirdPartyResource
)
(
result
*
extensions
.
ThirdPartyResource
,
err
error
)
{
result
=
&
extensions
.
ThirdPartyResource
{}
err
=
c
.
client
.
Put
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
Name
(
thirdPartyResource
.
Name
)
.
Body
(
thirdPartyResource
)
.
...
...
@@ -82,7 +78,6 @@ func (c *thirdPartyResources) Update(thirdPartyResource *extensions.ThirdPartyRe
// Delete takes name of the thirdPartyResource and deletes it. Returns an error if one occurs.
func
(
c
*
thirdPartyResources
)
Delete
(
name
string
,
options
*
api
.
DeleteOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
Name
(
name
)
.
Body
(
options
)
.
...
...
@@ -93,7 +88,6 @@ func (c *thirdPartyResources) Delete(name string, options *api.DeleteOptions) er
// DeleteCollection deletes a collection of objects.
func
(
c
*
thirdPartyResources
)
DeleteCollection
(
options
*
api
.
DeleteOptions
,
listOptions
api
.
ListOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
VersionedParams
(
&
listOptions
,
api
.
ParameterCodec
)
.
Body
(
options
)
.
...
...
@@ -105,7 +99,6 @@ func (c *thirdPartyResources) DeleteCollection(options *api.DeleteOptions, listO
func
(
c
*
thirdPartyResources
)
Get
(
name
string
)
(
result
*
extensions
.
ThirdPartyResource
,
err
error
)
{
result
=
&
extensions
.
ThirdPartyResource
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
Name
(
name
)
.
Do
()
.
...
...
@@ -117,7 +110,6 @@ func (c *thirdPartyResources) Get(name string) (result *extensions.ThirdPartyRes
func
(
c
*
thirdPartyResources
)
List
(
opts
api
.
ListOptions
)
(
result
*
extensions
.
ThirdPartyResourceList
,
err
error
)
{
result
=
&
extensions
.
ThirdPartyResourceList
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
VersionedParams
(
&
opts
,
api
.
ParameterCodec
)
.
Do
()
.
...
...
@@ -129,7 +121,6 @@ func (c *thirdPartyResources) List(opts api.ListOptions) (result *extensions.Thi
func
(
c
*
thirdPartyResources
)
Watch
(
opts
api
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
client
.
Get
()
.
Prefix
(
"watch"
)
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
VersionedParams
(
&
opts
,
api
.
ParameterCodec
)
.
Watch
()
...
...
pkg/client/clientset_generated/release_1_2/typed/extensions/v1beta1/extensions_client.go
View file @
e41d5047
...
...
@@ -66,8 +66,8 @@ func (c *ExtensionsClient) Scales(namespace string) ScaleInterface {
return
newScales
(
c
,
namespace
)
}
func
(
c
*
ExtensionsClient
)
ThirdPartyResources
(
namespace
string
)
ThirdPartyResourceInterface
{
return
newThirdPartyResources
(
c
,
namespace
)
func
(
c
*
ExtensionsClient
)
ThirdPartyResources
()
ThirdPartyResourceInterface
{
return
newThirdPartyResources
(
c
)
}
// NewForConfig creates a new ExtensionsClient for the given config.
...
...
pkg/client/clientset_generated/release_1_2/typed/extensions/v1beta1/fake/fake_extensions_client.go
View file @
e41d5047
...
...
@@ -53,6 +53,6 @@ func (c *FakeExtensions) Scales(namespace string) v1beta1.ScaleInterface {
return
&
FakeScales
{
c
,
namespace
}
}
func
(
c
*
FakeExtensions
)
ThirdPartyResources
(
namespace
string
)
v1beta1
.
ThirdPartyResourceInterface
{
return
&
FakeThirdPartyResources
{
c
,
namespace
}
func
(
c
*
FakeExtensions
)
ThirdPartyResources
()
v1beta1
.
ThirdPartyResourceInterface
{
return
&
FakeThirdPartyResources
{
c
}
}
pkg/client/clientset_generated/release_1_2/typed/extensions/v1beta1/fake/fake_thirdpartyresource.go
View file @
e41d5047
...
...
@@ -28,14 +28,13 @@ import (
// FakeThirdPartyResources implements ThirdPartyResourceInterface
type
FakeThirdPartyResources
struct
{
Fake
*
FakeExtensions
ns
string
}
var
thirdpartyresourcesResource
=
unversioned
.
GroupVersionResource
{
Group
:
"extensions"
,
Version
:
"v1beta1"
,
Resource
:
"thirdpartyresources"
}
func
(
c
*
FakeThirdPartyResources
)
Create
(
thirdPartyResource
*
v1beta1
.
ThirdPartyResource
)
(
result
*
v1beta1
.
ThirdPartyResource
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
core
.
New
CreateAction
(
thirdpartyresourcesResource
,
c
.
ns
,
thirdPartyResource
),
&
v1beta1
.
ThirdPartyResource
{})
Invokes
(
core
.
New
RootCreateAction
(
thirdpartyresourcesResource
,
thirdPartyResource
),
&
v1beta1
.
ThirdPartyResource
{})
if
obj
==
nil
{
return
nil
,
err
...
...
@@ -45,7 +44,7 @@ func (c *FakeThirdPartyResources) Create(thirdPartyResource *v1beta1.ThirdPartyR
func
(
c
*
FakeThirdPartyResources
)
Update
(
thirdPartyResource
*
v1beta1
.
ThirdPartyResource
)
(
result
*
v1beta1
.
ThirdPartyResource
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
core
.
New
UpdateAction
(
thirdpartyresourcesResource
,
c
.
ns
,
thirdPartyResource
),
&
v1beta1
.
ThirdPartyResource
{})
Invokes
(
core
.
New
RootUpdateAction
(
thirdpartyresourcesResource
,
thirdPartyResource
),
&
v1beta1
.
ThirdPartyResource
{})
if
obj
==
nil
{
return
nil
,
err
...
...
@@ -55,13 +54,13 @@ func (c *FakeThirdPartyResources) Update(thirdPartyResource *v1beta1.ThirdPartyR
func
(
c
*
FakeThirdPartyResources
)
Delete
(
name
string
,
options
*
api
.
DeleteOptions
)
error
{
_
,
err
:=
c
.
Fake
.
Invokes
(
core
.
New
DeleteAction
(
thirdpartyresourcesResource
,
c
.
ns
,
name
),
&
v1beta1
.
ThirdPartyResource
{})
Invokes
(
core
.
New
RootDeleteAction
(
thirdpartyresourcesResource
,
name
),
&
v1beta1
.
ThirdPartyResource
{})
return
err
}
func
(
c
*
FakeThirdPartyResources
)
DeleteCollection
(
options
*
api
.
DeleteOptions
,
listOptions
api
.
ListOptions
)
error
{
action
:=
core
.
New
DeleteCollectionAction
(
thirdpartyresourcesResource
,
c
.
ns
,
listOptions
)
action
:=
core
.
New
RootDeleteCollectionAction
(
thirdpartyresourcesResource
,
listOptions
)
_
,
err
:=
c
.
Fake
.
Invokes
(
action
,
&
v1beta1
.
ThirdPartyResourceList
{})
return
err
...
...
@@ -69,7 +68,7 @@ func (c *FakeThirdPartyResources) DeleteCollection(options *api.DeleteOptions, l
func
(
c
*
FakeThirdPartyResources
)
Get
(
name
string
)
(
result
*
v1beta1
.
ThirdPartyResource
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
core
.
New
GetAction
(
thirdpartyresourcesResource
,
c
.
ns
,
name
),
&
v1beta1
.
ThirdPartyResource
{})
Invokes
(
core
.
New
RootGetAction
(
thirdpartyresourcesResource
,
name
),
&
v1beta1
.
ThirdPartyResource
{})
if
obj
==
nil
{
return
nil
,
err
...
...
@@ -79,7 +78,7 @@ func (c *FakeThirdPartyResources) Get(name string) (result *v1beta1.ThirdPartyRe
func
(
c
*
FakeThirdPartyResources
)
List
(
opts
api
.
ListOptions
)
(
result
*
v1beta1
.
ThirdPartyResourceList
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
core
.
New
ListAction
(
thirdpartyresourcesResource
,
c
.
ns
,
opts
),
&
v1beta1
.
ThirdPartyResourceList
{})
Invokes
(
core
.
New
RootListAction
(
thirdpartyresourcesResource
,
opts
),
&
v1beta1
.
ThirdPartyResourceList
{})
if
obj
==
nil
{
return
nil
,
err
...
...
@@ -101,6 +100,6 @@ func (c *FakeThirdPartyResources) List(opts api.ListOptions) (result *v1beta1.Th
// Watch returns a watch.Interface that watches the requested thirdPartyResources.
func
(
c
*
FakeThirdPartyResources
)
Watch
(
opts
api
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
Fake
.
InvokesWatch
(
core
.
New
WatchAction
(
thirdpartyresourcesResource
,
c
.
ns
,
opts
))
InvokesWatch
(
core
.
New
RootWatchAction
(
thirdpartyresourcesResource
,
opts
))
}
pkg/client/clientset_generated/release_1_2/typed/extensions/v1beta1/thirdpartyresource.go
View file @
e41d5047
...
...
@@ -25,7 +25,7 @@ import (
// ThirdPartyResourcesGetter has a method to return a ThirdPartyResourceInterface.
// A group's client should implement this interface.
type
ThirdPartyResourcesGetter
interface
{
ThirdPartyResources
(
namespace
string
)
ThirdPartyResourceInterface
ThirdPartyResources
()
ThirdPartyResourceInterface
}
// ThirdPartyResourceInterface has methods to work with ThirdPartyResource resources.
...
...
@@ -43,14 +43,12 @@ type ThirdPartyResourceInterface interface {
// thirdPartyResources implements ThirdPartyResourceInterface
type
thirdPartyResources
struct
{
client
*
ExtensionsClient
ns
string
}
// newThirdPartyResources returns a ThirdPartyResources
func
newThirdPartyResources
(
c
*
ExtensionsClient
,
namespace
string
)
*
thirdPartyResources
{
func
newThirdPartyResources
(
c
*
ExtensionsClient
)
*
thirdPartyResources
{
return
&
thirdPartyResources
{
client
:
c
,
ns
:
namespace
,
}
}
...
...
@@ -58,7 +56,6 @@ func newThirdPartyResources(c *ExtensionsClient, namespace string) *thirdPartyRe
func
(
c
*
thirdPartyResources
)
Create
(
thirdPartyResource
*
v1beta1
.
ThirdPartyResource
)
(
result
*
v1beta1
.
ThirdPartyResource
,
err
error
)
{
result
=
&
v1beta1
.
ThirdPartyResource
{}
err
=
c
.
client
.
Post
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
Body
(
thirdPartyResource
)
.
Do
()
.
...
...
@@ -70,7 +67,6 @@ func (c *thirdPartyResources) Create(thirdPartyResource *v1beta1.ThirdPartyResou
func
(
c
*
thirdPartyResources
)
Update
(
thirdPartyResource
*
v1beta1
.
ThirdPartyResource
)
(
result
*
v1beta1
.
ThirdPartyResource
,
err
error
)
{
result
=
&
v1beta1
.
ThirdPartyResource
{}
err
=
c
.
client
.
Put
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
Name
(
thirdPartyResource
.
Name
)
.
Body
(
thirdPartyResource
)
.
...
...
@@ -82,7 +78,6 @@ func (c *thirdPartyResources) Update(thirdPartyResource *v1beta1.ThirdPartyResou
// Delete takes name of the thirdPartyResource and deletes it. Returns an error if one occurs.
func
(
c
*
thirdPartyResources
)
Delete
(
name
string
,
options
*
api
.
DeleteOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
Name
(
name
)
.
Body
(
options
)
.
...
...
@@ -93,7 +88,6 @@ func (c *thirdPartyResources) Delete(name string, options *api.DeleteOptions) er
// DeleteCollection deletes a collection of objects.
func
(
c
*
thirdPartyResources
)
DeleteCollection
(
options
*
api
.
DeleteOptions
,
listOptions
api
.
ListOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
VersionedParams
(
&
listOptions
,
api
.
ParameterCodec
)
.
Body
(
options
)
.
...
...
@@ -105,7 +99,6 @@ func (c *thirdPartyResources) DeleteCollection(options *api.DeleteOptions, listO
func
(
c
*
thirdPartyResources
)
Get
(
name
string
)
(
result
*
v1beta1
.
ThirdPartyResource
,
err
error
)
{
result
=
&
v1beta1
.
ThirdPartyResource
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
Name
(
name
)
.
Do
()
.
...
...
@@ -117,7 +110,6 @@ func (c *thirdPartyResources) Get(name string) (result *v1beta1.ThirdPartyResour
func
(
c
*
thirdPartyResources
)
List
(
opts
api
.
ListOptions
)
(
result
*
v1beta1
.
ThirdPartyResourceList
,
err
error
)
{
result
=
&
v1beta1
.
ThirdPartyResourceList
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
VersionedParams
(
&
opts
,
api
.
ParameterCodec
)
.
Do
()
.
...
...
@@ -129,7 +121,6 @@ func (c *thirdPartyResources) List(opts api.ListOptions) (result *v1beta1.ThirdP
func
(
c
*
thirdPartyResources
)
Watch
(
opts
api
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
client
.
Get
()
.
Prefix
(
"watch"
)
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
VersionedParams
(
&
opts
,
api
.
ParameterCodec
)
.
Watch
()
...
...
pkg/client/clientset_generated/release_1_3/typed/extensions/v1beta1/extensions_client.go
View file @
e41d5047
...
...
@@ -67,8 +67,8 @@ func (c *ExtensionsClient) Scales(namespace string) ScaleInterface {
return
newScales
(
c
,
namespace
)
}
func
(
c
*
ExtensionsClient
)
ThirdPartyResources
(
namespace
string
)
ThirdPartyResourceInterface
{
return
newThirdPartyResources
(
c
,
namespace
)
func
(
c
*
ExtensionsClient
)
ThirdPartyResources
()
ThirdPartyResourceInterface
{
return
newThirdPartyResources
(
c
)
}
// NewForConfig creates a new ExtensionsClient for the given config.
...
...
pkg/client/clientset_generated/release_1_3/typed/extensions/v1beta1/fake/fake_extensions_client.go
View file @
e41d5047
...
...
@@ -53,6 +53,6 @@ func (c *FakeExtensions) Scales(namespace string) v1beta1.ScaleInterface {
return
&
FakeScales
{
c
,
namespace
}
}
func
(
c
*
FakeExtensions
)
ThirdPartyResources
(
namespace
string
)
v1beta1
.
ThirdPartyResourceInterface
{
return
&
FakeThirdPartyResources
{
c
,
namespace
}
func
(
c
*
FakeExtensions
)
ThirdPartyResources
()
v1beta1
.
ThirdPartyResourceInterface
{
return
&
FakeThirdPartyResources
{
c
}
}
pkg/client/clientset_generated/release_1_3/typed/extensions/v1beta1/fake/fake_thirdpartyresource.go
View file @
e41d5047
...
...
@@ -28,14 +28,13 @@ import (
// FakeThirdPartyResources implements ThirdPartyResourceInterface
type
FakeThirdPartyResources
struct
{
Fake
*
FakeExtensions
ns
string
}
var
thirdpartyresourcesResource
=
unversioned
.
GroupVersionResource
{
Group
:
"extensions"
,
Version
:
"v1beta1"
,
Resource
:
"thirdpartyresources"
}
func
(
c
*
FakeThirdPartyResources
)
Create
(
thirdPartyResource
*
v1beta1
.
ThirdPartyResource
)
(
result
*
v1beta1
.
ThirdPartyResource
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
core
.
New
CreateAction
(
thirdpartyresourcesResource
,
c
.
ns
,
thirdPartyResource
),
&
v1beta1
.
ThirdPartyResource
{})
Invokes
(
core
.
New
RootCreateAction
(
thirdpartyresourcesResource
,
thirdPartyResource
),
&
v1beta1
.
ThirdPartyResource
{})
if
obj
==
nil
{
return
nil
,
err
...
...
@@ -45,7 +44,7 @@ func (c *FakeThirdPartyResources) Create(thirdPartyResource *v1beta1.ThirdPartyR
func
(
c
*
FakeThirdPartyResources
)
Update
(
thirdPartyResource
*
v1beta1
.
ThirdPartyResource
)
(
result
*
v1beta1
.
ThirdPartyResource
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
core
.
New
UpdateAction
(
thirdpartyresourcesResource
,
c
.
ns
,
thirdPartyResource
),
&
v1beta1
.
ThirdPartyResource
{})
Invokes
(
core
.
New
RootUpdateAction
(
thirdpartyresourcesResource
,
thirdPartyResource
),
&
v1beta1
.
ThirdPartyResource
{})
if
obj
==
nil
{
return
nil
,
err
...
...
@@ -55,13 +54,13 @@ func (c *FakeThirdPartyResources) Update(thirdPartyResource *v1beta1.ThirdPartyR
func
(
c
*
FakeThirdPartyResources
)
Delete
(
name
string
,
options
*
api
.
DeleteOptions
)
error
{
_
,
err
:=
c
.
Fake
.
Invokes
(
core
.
New
DeleteAction
(
thirdpartyresourcesResource
,
c
.
ns
,
name
),
&
v1beta1
.
ThirdPartyResource
{})
Invokes
(
core
.
New
RootDeleteAction
(
thirdpartyresourcesResource
,
name
),
&
v1beta1
.
ThirdPartyResource
{})
return
err
}
func
(
c
*
FakeThirdPartyResources
)
DeleteCollection
(
options
*
api
.
DeleteOptions
,
listOptions
api
.
ListOptions
)
error
{
action
:=
core
.
New
DeleteCollectionAction
(
thirdpartyresourcesResource
,
c
.
ns
,
listOptions
)
action
:=
core
.
New
RootDeleteCollectionAction
(
thirdpartyresourcesResource
,
listOptions
)
_
,
err
:=
c
.
Fake
.
Invokes
(
action
,
&
v1beta1
.
ThirdPartyResourceList
{})
return
err
...
...
@@ -69,7 +68,7 @@ func (c *FakeThirdPartyResources) DeleteCollection(options *api.DeleteOptions, l
func
(
c
*
FakeThirdPartyResources
)
Get
(
name
string
)
(
result
*
v1beta1
.
ThirdPartyResource
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
core
.
New
GetAction
(
thirdpartyresourcesResource
,
c
.
ns
,
name
),
&
v1beta1
.
ThirdPartyResource
{})
Invokes
(
core
.
New
RootGetAction
(
thirdpartyresourcesResource
,
name
),
&
v1beta1
.
ThirdPartyResource
{})
if
obj
==
nil
{
return
nil
,
err
...
...
@@ -79,7 +78,7 @@ func (c *FakeThirdPartyResources) Get(name string) (result *v1beta1.ThirdPartyRe
func
(
c
*
FakeThirdPartyResources
)
List
(
opts
api
.
ListOptions
)
(
result
*
v1beta1
.
ThirdPartyResourceList
,
err
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
core
.
New
ListAction
(
thirdpartyresourcesResource
,
c
.
ns
,
opts
),
&
v1beta1
.
ThirdPartyResourceList
{})
Invokes
(
core
.
New
RootListAction
(
thirdpartyresourcesResource
,
opts
),
&
v1beta1
.
ThirdPartyResourceList
{})
if
obj
==
nil
{
return
nil
,
err
...
...
@@ -101,6 +100,6 @@ func (c *FakeThirdPartyResources) List(opts api.ListOptions) (result *v1beta1.Th
// Watch returns a watch.Interface that watches the requested thirdPartyResources.
func
(
c
*
FakeThirdPartyResources
)
Watch
(
opts
api
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
Fake
.
InvokesWatch
(
core
.
New
WatchAction
(
thirdpartyresourcesResource
,
c
.
ns
,
opts
))
InvokesWatch
(
core
.
New
RootWatchAction
(
thirdpartyresourcesResource
,
opts
))
}
pkg/client/clientset_generated/release_1_3/typed/extensions/v1beta1/thirdpartyresource.go
View file @
e41d5047
...
...
@@ -25,7 +25,7 @@ import (
// ThirdPartyResourcesGetter has a method to return a ThirdPartyResourceInterface.
// A group's client should implement this interface.
type
ThirdPartyResourcesGetter
interface
{
ThirdPartyResources
(
namespace
string
)
ThirdPartyResourceInterface
ThirdPartyResources
()
ThirdPartyResourceInterface
}
// ThirdPartyResourceInterface has methods to work with ThirdPartyResource resources.
...
...
@@ -47,10 +47,9 @@ type thirdPartyResources struct {
}
// newThirdPartyResources returns a ThirdPartyResources
func
newThirdPartyResources
(
c
*
ExtensionsClient
,
namespace
string
)
*
thirdPartyResources
{
func
newThirdPartyResources
(
c
*
ExtensionsClient
)
*
thirdPartyResources
{
return
&
thirdPartyResources
{
client
:
c
,
ns
:
namespace
,
}
}
...
...
@@ -58,7 +57,6 @@ func newThirdPartyResources(c *ExtensionsClient, namespace string) *thirdPartyRe
func
(
c
*
thirdPartyResources
)
Create
(
thirdPartyResource
*
v1beta1
.
ThirdPartyResource
)
(
result
*
v1beta1
.
ThirdPartyResource
,
err
error
)
{
result
=
&
v1beta1
.
ThirdPartyResource
{}
err
=
c
.
client
.
Post
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
Body
(
thirdPartyResource
)
.
Do
()
.
...
...
@@ -70,7 +68,6 @@ func (c *thirdPartyResources) Create(thirdPartyResource *v1beta1.ThirdPartyResou
func
(
c
*
thirdPartyResources
)
Update
(
thirdPartyResource
*
v1beta1
.
ThirdPartyResource
)
(
result
*
v1beta1
.
ThirdPartyResource
,
err
error
)
{
result
=
&
v1beta1
.
ThirdPartyResource
{}
err
=
c
.
client
.
Put
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
Name
(
thirdPartyResource
.
Name
)
.
Body
(
thirdPartyResource
)
.
...
...
@@ -82,7 +79,6 @@ func (c *thirdPartyResources) Update(thirdPartyResource *v1beta1.ThirdPartyResou
// Delete takes name of the thirdPartyResource and deletes it. Returns an error if one occurs.
func
(
c
*
thirdPartyResources
)
Delete
(
name
string
,
options
*
api
.
DeleteOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
Name
(
name
)
.
Body
(
options
)
.
...
...
@@ -93,7 +89,6 @@ func (c *thirdPartyResources) Delete(name string, options *api.DeleteOptions) er
// DeleteCollection deletes a collection of objects.
func
(
c
*
thirdPartyResources
)
DeleteCollection
(
options
*
api
.
DeleteOptions
,
listOptions
api
.
ListOptions
)
error
{
return
c
.
client
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
VersionedParams
(
&
listOptions
,
api
.
ParameterCodec
)
.
Body
(
options
)
.
...
...
@@ -105,7 +100,6 @@ func (c *thirdPartyResources) DeleteCollection(options *api.DeleteOptions, listO
func
(
c
*
thirdPartyResources
)
Get
(
name
string
)
(
result
*
v1beta1
.
ThirdPartyResource
,
err
error
)
{
result
=
&
v1beta1
.
ThirdPartyResource
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
Name
(
name
)
.
Do
()
.
...
...
@@ -117,7 +111,6 @@ func (c *thirdPartyResources) Get(name string) (result *v1beta1.ThirdPartyResour
func
(
c
*
thirdPartyResources
)
List
(
opts
api
.
ListOptions
)
(
result
*
v1beta1
.
ThirdPartyResourceList
,
err
error
)
{
result
=
&
v1beta1
.
ThirdPartyResourceList
{}
err
=
c
.
client
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
VersionedParams
(
&
opts
,
api
.
ParameterCodec
)
.
Do
()
.
...
...
@@ -129,7 +122,6 @@ func (c *thirdPartyResources) List(opts api.ListOptions) (result *v1beta1.ThirdP
func
(
c
*
thirdPartyResources
)
Watch
(
opts
api
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
client
.
Get
()
.
Prefix
(
"watch"
)
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
VersionedParams
(
&
opts
,
api
.
ParameterCodec
)
.
Watch
()
...
...
pkg/client/unversioned/extensions.go
View file @
e41d5047
...
...
@@ -74,8 +74,8 @@ func (c *ExtensionsClient) Ingress(namespace string) IngressInterface {
return
newIngress
(
c
,
namespace
)
}
func
(
c
*
ExtensionsClient
)
ThirdPartyResources
(
namespace
string
)
ThirdPartyResourceInterface
{
return
newThirdPartyResources
(
c
,
namespace
)
func
(
c
*
ExtensionsClient
)
ThirdPartyResources
()
ThirdPartyResourceInterface
{
return
newThirdPartyResources
(
c
)
}
func
(
c
*
ExtensionsClient
)
ReplicaSets
(
namespace
string
)
ReplicaSetInterface
{
...
...
pkg/client/unversioned/testclient/fake_thirdpartyresources.go
View file @
e41d5047
...
...
@@ -26,15 +26,14 @@ import (
// FakeThirdPartyResources implements ThirdPartyResourceInterface. Meant to be embedded into a struct to get a default
// implementation. This makes faking out just the method you want to test easier.
type
FakeThirdPartyResources
struct
{
Fake
*
FakeExperimental
Namespace
string
Fake
*
FakeExperimental
}
// Ensure statically that FakeThirdPartyResources implements DaemonInterface.
var
_
kclientlib
.
ThirdPartyResourceInterface
=
&
FakeThirdPartyResources
{}
func
(
c
*
FakeThirdPartyResources
)
Get
(
name
string
)
(
*
extensions
.
ThirdPartyResource
,
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
NewGetAction
(
"thirdpartyresources"
,
c
.
Namespace
,
name
),
&
extensions
.
ThirdPartyResource
{})
obj
,
err
:=
c
.
Fake
.
Invokes
(
NewGetAction
(
"thirdpartyresources"
,
""
,
name
),
&
extensions
.
ThirdPartyResource
{})
if
obj
==
nil
{
return
nil
,
err
}
...
...
@@ -42,7 +41,7 @@ func (c *FakeThirdPartyResources) Get(name string) (*extensions.ThirdPartyResour
}
func
(
c
*
FakeThirdPartyResources
)
List
(
opts
api
.
ListOptions
)
(
*
extensions
.
ThirdPartyResourceList
,
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
NewListAction
(
"thirdpartyresources"
,
c
.
Namespace
,
opts
),
&
extensions
.
ThirdPartyResourceList
{})
obj
,
err
:=
c
.
Fake
.
Invokes
(
NewListAction
(
"thirdpartyresources"
,
""
,
opts
),
&
extensions
.
ThirdPartyResourceList
{})
if
obj
==
nil
{
return
nil
,
err
}
...
...
@@ -50,7 +49,7 @@ func (c *FakeThirdPartyResources) List(opts api.ListOptions) (*extensions.ThirdP
}
func
(
c
*
FakeThirdPartyResources
)
Create
(
daemon
*
extensions
.
ThirdPartyResource
)
(
*
extensions
.
ThirdPartyResource
,
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
NewCreateAction
(
"thirdpartyresources"
,
c
.
Namespace
,
daemon
),
&
extensions
.
ThirdPartyResource
{})
obj
,
err
:=
c
.
Fake
.
Invokes
(
NewCreateAction
(
"thirdpartyresources"
,
""
,
daemon
),
&
extensions
.
ThirdPartyResource
{})
if
obj
==
nil
{
return
nil
,
err
}
...
...
@@ -58,7 +57,7 @@ func (c *FakeThirdPartyResources) Create(daemon *extensions.ThirdPartyResource)
}
func
(
c
*
FakeThirdPartyResources
)
Update
(
daemon
*
extensions
.
ThirdPartyResource
)
(
*
extensions
.
ThirdPartyResource
,
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
NewUpdateAction
(
"thirdpartyresources"
,
c
.
Namespace
,
daemon
),
&
extensions
.
ThirdPartyResource
{})
obj
,
err
:=
c
.
Fake
.
Invokes
(
NewUpdateAction
(
"thirdpartyresources"
,
""
,
daemon
),
&
extensions
.
ThirdPartyResource
{})
if
obj
==
nil
{
return
nil
,
err
}
...
...
@@ -66,7 +65,7 @@ func (c *FakeThirdPartyResources) Update(daemon *extensions.ThirdPartyResource)
}
func
(
c
*
FakeThirdPartyResources
)
UpdateStatus
(
daemon
*
extensions
.
ThirdPartyResource
)
(
*
extensions
.
ThirdPartyResource
,
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
NewUpdateSubresourceAction
(
"thirdpartyresources"
,
"status"
,
c
.
Namespace
,
daemon
),
&
extensions
.
ThirdPartyResource
{})
obj
,
err
:=
c
.
Fake
.
Invokes
(
NewUpdateSubresourceAction
(
"thirdpartyresources"
,
"status"
,
""
,
daemon
),
&
extensions
.
ThirdPartyResource
{})
if
obj
==
nil
{
return
nil
,
err
}
...
...
@@ -74,10 +73,10 @@ func (c *FakeThirdPartyResources) UpdateStatus(daemon *extensions.ThirdPartyReso
}
func
(
c
*
FakeThirdPartyResources
)
Delete
(
name
string
)
error
{
_
,
err
:=
c
.
Fake
.
Invokes
(
NewDeleteAction
(
"thirdpartyresources"
,
c
.
Namespace
,
name
),
&
extensions
.
ThirdPartyResource
{})
_
,
err
:=
c
.
Fake
.
Invokes
(
NewDeleteAction
(
"thirdpartyresources"
,
""
,
name
),
&
extensions
.
ThirdPartyResource
{})
return
err
}
func
(
c
*
FakeThirdPartyResources
)
Watch
(
opts
api
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
Fake
.
InvokesWatch
(
NewWatchAction
(
"thirdpartyresources"
,
c
.
Namespace
,
opts
))
return
c
.
Fake
.
InvokesWatch
(
NewWatchAction
(
"thirdpartyresources"
,
""
,
opts
))
}
pkg/client/unversioned/testclient/testclient.go
View file @
e41d5047
...
...
@@ -374,8 +374,8 @@ func (c *FakeExperimental) Ingress(namespace string) client.IngressInterface {
return
&
FakeIngress
{
Fake
:
c
,
Namespace
:
namespace
}
}
func
(
c
*
FakeExperimental
)
ThirdPartyResources
(
namespace
string
)
client
.
ThirdPartyResourceInterface
{
return
&
FakeThirdPartyResources
{
Fake
:
c
,
Namespace
:
namespace
}
func
(
c
*
FakeExperimental
)
ThirdPartyResources
()
client
.
ThirdPartyResourceInterface
{
return
&
FakeThirdPartyResources
{
Fake
:
c
}
}
func
(
c
*
FakeExperimental
)
ReplicaSets
(
namespace
string
)
client
.
ReplicaSetInterface
{
...
...
pkg/client/unversioned/thirdpartyresources.go
View file @
e41d5047
...
...
@@ -24,7 +24,7 @@ import (
// ThirdPartyResourceNamespacer has methods to work with ThirdPartyResource resources in a namespace
type
ThirdPartyResourceNamespacer
interface
{
ThirdPartyResources
(
namespace
string
)
ThirdPartyResourceInterface
ThirdPartyResources
()
ThirdPartyResourceInterface
}
type
ThirdPartyResourceInterface
interface
{
...
...
@@ -39,12 +39,11 @@ type ThirdPartyResourceInterface interface {
// thirdPartyResources implements DaemonsSetsNamespacer interface
type
thirdPartyResources
struct
{
r
*
ExtensionsClient
ns
string
r
*
ExtensionsClient
}
func
newThirdPartyResources
(
c
*
ExtensionsClient
,
namespace
string
)
*
thirdPartyResources
{
return
&
thirdPartyResources
{
c
,
namespace
}
func
newThirdPartyResources
(
c
*
ExtensionsClient
)
*
thirdPartyResources
{
return
&
thirdPartyResources
{
c
}
}
// Ensure statically that thirdPartyResources implements ThirdPartyResourcesInterface.
...
...
@@ -52,48 +51,47 @@ var _ ThirdPartyResourceInterface = &thirdPartyResources{}
func
(
c
*
thirdPartyResources
)
List
(
opts
api
.
ListOptions
)
(
result
*
extensions
.
ThirdPartyResourceList
,
err
error
)
{
result
=
&
extensions
.
ThirdPartyResourceList
{}
err
=
c
.
r
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
VersionedParams
(
&
opts
,
api
.
ParameterCodec
)
.
Do
()
.
Into
(
result
)
err
=
c
.
r
.
Get
()
.
Resource
(
"thirdpartyresources"
)
.
VersionedParams
(
&
opts
,
api
.
ParameterCodec
)
.
Do
()
.
Into
(
result
)
return
}
// Get returns information about a particular third party resource.
func
(
c
*
thirdPartyResources
)
Get
(
name
string
)
(
result
*
extensions
.
ThirdPartyResource
,
err
error
)
{
result
=
&
extensions
.
ThirdPartyResource
{}
err
=
c
.
r
.
Get
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
Name
(
name
)
.
Do
()
.
Into
(
result
)
err
=
c
.
r
.
Get
()
.
Resource
(
"thirdpartyresources"
)
.
Name
(
name
)
.
Do
()
.
Into
(
result
)
return
}
// Create creates a new third party resource.
func
(
c
*
thirdPartyResources
)
Create
(
resource
*
extensions
.
ThirdPartyResource
)
(
result
*
extensions
.
ThirdPartyResource
,
err
error
)
{
result
=
&
extensions
.
ThirdPartyResource
{}
err
=
c
.
r
.
Post
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
Body
(
resource
)
.
Do
()
.
Into
(
result
)
err
=
c
.
r
.
Post
()
.
Resource
(
"thirdpartyresources"
)
.
Body
(
resource
)
.
Do
()
.
Into
(
result
)
return
}
// Update updates an existing third party resource.
func
(
c
*
thirdPartyResources
)
Update
(
resource
*
extensions
.
ThirdPartyResource
)
(
result
*
extensions
.
ThirdPartyResource
,
err
error
)
{
result
=
&
extensions
.
ThirdPartyResource
{}
err
=
c
.
r
.
Put
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
Name
(
resource
.
Name
)
.
Body
(
resource
)
.
Do
()
.
Into
(
result
)
err
=
c
.
r
.
Put
()
.
Resource
(
"thirdpartyresources"
)
.
Name
(
resource
.
Name
)
.
Body
(
resource
)
.
Do
()
.
Into
(
result
)
return
}
// UpdateStatus updates an existing third party resource status
func
(
c
*
thirdPartyResources
)
UpdateStatus
(
resource
*
extensions
.
ThirdPartyResource
)
(
result
*
extensions
.
ThirdPartyResource
,
err
error
)
{
result
=
&
extensions
.
ThirdPartyResource
{}
err
=
c
.
r
.
Put
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
Name
(
resource
.
Name
)
.
SubResource
(
"status"
)
.
Body
(
resource
)
.
Do
()
.
Into
(
result
)
err
=
c
.
r
.
Put
()
.
Resource
(
"thirdpartyresources"
)
.
Name
(
resource
.
Name
)
.
SubResource
(
"status"
)
.
Body
(
resource
)
.
Do
()
.
Into
(
result
)
return
}
// Delete deletes an existing third party resource.
func
(
c
*
thirdPartyResources
)
Delete
(
name
string
)
error
{
return
c
.
r
.
Delete
()
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
Name
(
name
)
.
Do
()
.
Error
()
return
c
.
r
.
Delete
()
.
Resource
(
"thirdpartyresources"
)
.
Name
(
name
)
.
Do
()
.
Error
()
}
// Watch returns a watch.Interface that watches the requested third party resources.
func
(
c
*
thirdPartyResources
)
Watch
(
opts
api
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
c
.
r
.
Get
()
.
Prefix
(
"watch"
)
.
Namespace
(
c
.
ns
)
.
Resource
(
"thirdpartyresources"
)
.
VersionedParams
(
&
opts
,
api
.
ParameterCodec
)
.
Watch
()
...
...
pkg/client/unversioned/thirdpartyresources_test.go
View file @
e41d5047
...
...
@@ -30,11 +30,10 @@ func getThirdPartyResourceName() string {
}
func
TestListThirdPartyResources
(
t
*
testing
.
T
)
{
ns
:=
api
.
NamespaceAll
c
:=
&
simple
.
Client
{
Request
:
simple
.
Request
{
Method
:
"GET"
,
Path
:
testapi
.
Extensions
.
ResourcePath
(
getThirdPartyResourceName
(),
ns
,
""
),
Path
:
testapi
.
Extensions
.
ResourcePath
(
getThirdPartyResourceName
(),
""
,
""
),
},
Response
:
simple
.
Response
{
StatusCode
:
200
,
Body
:
&
extensions
.
ThirdPartyResourceList
{
...
...
@@ -53,16 +52,15 @@ func TestListThirdPartyResources(t *testing.T) {
},
},
}
receivedDSs
,
err
:=
c
.
Setup
(
t
)
.
Extensions
()
.
ThirdPartyResources
(
ns
)
.
List
(
api
.
ListOptions
{})
receivedDSs
,
err
:=
c
.
Setup
(
t
)
.
Extensions
()
.
ThirdPartyResources
()
.
List
(
api
.
ListOptions
{})
defer
c
.
Close
()
c
.
Validate
(
t
,
receivedDSs
,
err
)
}
func
TestGetThirdPartyResource
(
t
*
testing
.
T
)
{
ns
:=
api
.
NamespaceDefault
c
:=
&
simple
.
Client
{
Request
:
simple
.
Request
{
Method
:
"GET"
,
Path
:
testapi
.
Extensions
.
ResourcePath
(
getThirdPartyResourceName
(),
ns
,
"foo"
),
Query
:
simple
.
BuildQueryValues
(
nil
)},
Request
:
simple
.
Request
{
Method
:
"GET"
,
Path
:
testapi
.
Extensions
.
ResourcePath
(
getThirdPartyResourceName
(),
""
,
"foo"
),
Query
:
simple
.
BuildQueryValues
(
nil
)},
Response
:
simple
.
Response
{
StatusCode
:
200
,
Body
:
&
extensions
.
ThirdPartyResource
{
...
...
@@ -77,15 +75,14 @@ func TestGetThirdPartyResource(t *testing.T) {
},
},
}
receivedThirdPartyResource
,
err
:=
c
.
Setup
(
t
)
.
Extensions
()
.
ThirdPartyResources
(
ns
)
.
Get
(
"foo"
)
receivedThirdPartyResource
,
err
:=
c
.
Setup
(
t
)
.
Extensions
()
.
ThirdPartyResources
()
.
Get
(
"foo"
)
defer
c
.
Close
()
c
.
Validate
(
t
,
receivedThirdPartyResource
,
err
)
}
func
TestGetThirdPartyResourceWithNoName
(
t
*
testing
.
T
)
{
ns
:=
api
.
NamespaceDefault
c
:=
&
simple
.
Client
{
Error
:
true
}
receivedPod
,
err
:=
c
.
Setup
(
t
)
.
Extensions
()
.
ThirdPartyResources
(
ns
)
.
Get
(
""
)
receivedPod
,
err
:=
c
.
Setup
(
t
)
.
Extensions
()
.
ThirdPartyResources
()
.
Get
(
""
)
defer
c
.
Close
()
if
(
err
!=
nil
)
&&
(
err
.
Error
()
!=
simple
.
NameRequiredError
)
{
t
.
Errorf
(
"Expected error: %v, but got %v"
,
simple
.
NameRequiredError
,
err
)
...
...
@@ -95,12 +92,11 @@ func TestGetThirdPartyResourceWithNoName(t *testing.T) {
}
func
TestUpdateThirdPartyResource
(
t
*
testing
.
T
)
{
ns
:=
api
.
NamespaceDefault
requestThirdPartyResource
:=
&
extensions
.
ThirdPartyResource
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"foo"
,
ResourceVersion
:
"1"
},
}
c
:=
&
simple
.
Client
{
Request
:
simple
.
Request
{
Method
:
"PUT"
,
Path
:
testapi
.
Extensions
.
ResourcePath
(
getThirdPartyResourceName
(),
ns
,
"foo"
),
Query
:
simple
.
BuildQueryValues
(
nil
)},
Request
:
simple
.
Request
{
Method
:
"PUT"
,
Path
:
testapi
.
Extensions
.
ResourcePath
(
getThirdPartyResourceName
(),
""
,
"foo"
),
Query
:
simple
.
BuildQueryValues
(
nil
)},
Response
:
simple
.
Response
{
StatusCode
:
200
,
Body
:
&
extensions
.
ThirdPartyResource
{
...
...
@@ -115,18 +111,17 @@ func TestUpdateThirdPartyResource(t *testing.T) {
},
},
}
receivedThirdPartyResource
,
err
:=
c
.
Setup
(
t
)
.
Extensions
()
.
ThirdPartyResources
(
ns
)
.
Update
(
requestThirdPartyResource
)
receivedThirdPartyResource
,
err
:=
c
.
Setup
(
t
)
.
Extensions
()
.
ThirdPartyResources
()
.
Update
(
requestThirdPartyResource
)
defer
c
.
Close
()
c
.
Validate
(
t
,
receivedThirdPartyResource
,
err
)
}
func
TestUpdateThirdPartyResourceUpdateStatus
(
t
*
testing
.
T
)
{
ns
:=
api
.
NamespaceDefault
requestThirdPartyResource
:=
&
extensions
.
ThirdPartyResource
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"foo"
,
ResourceVersion
:
"1"
},
}
c
:=
&
simple
.
Client
{
Request
:
simple
.
Request
{
Method
:
"PUT"
,
Path
:
testapi
.
Extensions
.
ResourcePath
(
getThirdPartyResourceName
(),
ns
,
"foo"
)
+
"/status"
,
Query
:
simple
.
BuildQueryValues
(
nil
)},
Request
:
simple
.
Request
{
Method
:
"PUT"
,
Path
:
testapi
.
Extensions
.
ResourcePath
(
getThirdPartyResourceName
(),
""
,
"foo"
)
+
"/status"
,
Query
:
simple
.
BuildQueryValues
(
nil
)},
Response
:
simple
.
Response
{
StatusCode
:
200
,
Body
:
&
extensions
.
ThirdPartyResource
{
...
...
@@ -141,29 +136,27 @@ func TestUpdateThirdPartyResourceUpdateStatus(t *testing.T) {
},
},
}
receivedThirdPartyResource
,
err
:=
c
.
Setup
(
t
)
.
Extensions
()
.
ThirdPartyResources
(
ns
)
.
UpdateStatus
(
requestThirdPartyResource
)
receivedThirdPartyResource
,
err
:=
c
.
Setup
(
t
)
.
Extensions
()
.
ThirdPartyResources
()
.
UpdateStatus
(
requestThirdPartyResource
)
defer
c
.
Close
()
c
.
Validate
(
t
,
receivedThirdPartyResource
,
err
)
}
func
TestDeleteThirdPartyResource
(
t
*
testing
.
T
)
{
ns
:=
api
.
NamespaceDefault
c
:=
&
simple
.
Client
{
Request
:
simple
.
Request
{
Method
:
"DELETE"
,
Path
:
testapi
.
Extensions
.
ResourcePath
(
getThirdPartyResourceName
(),
ns
,
"foo"
),
Query
:
simple
.
BuildQueryValues
(
nil
)},
Request
:
simple
.
Request
{
Method
:
"DELETE"
,
Path
:
testapi
.
Extensions
.
ResourcePath
(
getThirdPartyResourceName
(),
""
,
"foo"
),
Query
:
simple
.
BuildQueryValues
(
nil
)},
Response
:
simple
.
Response
{
StatusCode
:
200
},
}
err
:=
c
.
Setup
(
t
)
.
Extensions
()
.
ThirdPartyResources
(
ns
)
.
Delete
(
"foo"
)
err
:=
c
.
Setup
(
t
)
.
Extensions
()
.
ThirdPartyResources
()
.
Delete
(
"foo"
)
defer
c
.
Close
()
c
.
Validate
(
t
,
nil
,
err
)
}
func
TestCreateThirdPartyResource
(
t
*
testing
.
T
)
{
ns
:=
api
.
NamespaceDefault
requestThirdPartyResource
:=
&
extensions
.
ThirdPartyResource
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"foo"
},
}
c
:=
&
simple
.
Client
{
Request
:
simple
.
Request
{
Method
:
"POST"
,
Path
:
testapi
.
Extensions
.
ResourcePath
(
getThirdPartyResourceName
(),
ns
,
""
),
Body
:
requestThirdPartyResource
,
Query
:
simple
.
BuildQueryValues
(
nil
)},
Request
:
simple
.
Request
{
Method
:
"POST"
,
Path
:
testapi
.
Extensions
.
ResourcePath
(
getThirdPartyResourceName
(),
""
,
""
),
Body
:
requestThirdPartyResource
,
Query
:
simple
.
BuildQueryValues
(
nil
)},
Response
:
simple
.
Response
{
StatusCode
:
200
,
Body
:
&
extensions
.
ThirdPartyResource
{
...
...
@@ -178,7 +171,7 @@ func TestCreateThirdPartyResource(t *testing.T) {
},
},
}
receivedThirdPartyResource
,
err
:=
c
.
Setup
(
t
)
.
Extensions
()
.
ThirdPartyResources
(
ns
)
.
Create
(
requestThirdPartyResource
)
receivedThirdPartyResource
,
err
:=
c
.
Setup
(
t
)
.
Extensions
()
.
ThirdPartyResources
()
.
Create
(
requestThirdPartyResource
)
defer
c
.
Close
()
c
.
Validate
(
t
,
receivedThirdPartyResource
,
err
)
}
pkg/registry/thirdpartyresource/etcd/etcd.go
View file @
e41d5047
...
...
@@ -43,10 +43,10 @@ func NewREST(opts generic.RESTOptions) *REST {
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
ThirdPartyResource
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
ThirdPartyResourceList
{}
},
KeyRootFunc
:
func
(
ctx
api
.
Context
)
string
{
return
registry
.
NamespaceKeyRootFunc
(
ctx
,
prefix
)
return
prefix
},
KeyFunc
:
func
(
ctx
api
.
Context
,
id
string
)
(
string
,
error
)
{
return
registry
.
NamespaceKeyFunc
(
ctx
,
prefix
,
id
)
return
registry
.
N
oN
amespaceKeyFunc
(
ctx
,
prefix
,
id
)
},
ObjectNameFunc
:
func
(
obj
runtime
.
Object
)
(
string
,
error
)
{
return
obj
.
(
*
extensions
.
ThirdPartyResource
)
.
Name
,
nil
...
...
pkg/registry/thirdpartyresource/etcd/etcd_test.go
View file @
e41d5047
...
...
@@ -40,8 +40,7 @@ func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
func
validNewThirdPartyResource
(
name
string
)
*
extensions
.
ThirdPartyResource
{
return
&
extensions
.
ThirdPartyResource
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
name
,
Namespace
:
api
.
NamespaceDefault
,
Name
:
name
,
},
Versions
:
[]
extensions
.
APIVersion
{
{
...
...
@@ -54,9 +53,9 @@ func validNewThirdPartyResource(name string) *extensions.ThirdPartyResource {
func
TestCreate
(
t
*
testing
.
T
)
{
storage
,
server
:=
newStorage
(
t
)
defer
server
.
Terminate
(
t
)
test
:=
registrytest
.
New
(
t
,
storage
.
Store
)
test
:=
registrytest
.
New
(
t
,
storage
.
Store
)
.
ClusterScope
()
rsrc
:=
validNewThirdPartyResource
(
"foo"
)
rsrc
.
ObjectMeta
=
api
.
ObjectMeta
{}
rsrc
.
ObjectMeta
=
api
.
ObjectMeta
{
GenerateName
:
"foo-"
}
test
.
TestCreate
(
// valid
rsrc
,
...
...
@@ -68,7 +67,7 @@ func TestCreate(t *testing.T) {
func
TestUpdate
(
t
*
testing
.
T
)
{
storage
,
server
:=
newStorage
(
t
)
defer
server
.
Terminate
(
t
)
test
:=
registrytest
.
New
(
t
,
storage
.
Store
)
test
:=
registrytest
.
New
(
t
,
storage
.
Store
)
.
ClusterScope
()
test
.
TestUpdate
(
// valid
validNewThirdPartyResource
(
"foo"
),
...
...
@@ -84,28 +83,28 @@ func TestUpdate(t *testing.T) {
func
TestDelete
(
t
*
testing
.
T
)
{
storage
,
server
:=
newStorage
(
t
)
defer
server
.
Terminate
(
t
)
test
:=
registrytest
.
New
(
t
,
storage
.
Store
)
test
:=
registrytest
.
New
(
t
,
storage
.
Store
)
.
ClusterScope
()
test
.
TestDelete
(
validNewThirdPartyResource
(
"foo"
))
}
func
TestGet
(
t
*
testing
.
T
)
{
storage
,
server
:=
newStorage
(
t
)
defer
server
.
Terminate
(
t
)
test
:=
registrytest
.
New
(
t
,
storage
.
Store
)
test
:=
registrytest
.
New
(
t
,
storage
.
Store
)
.
ClusterScope
()
test
.
TestGet
(
validNewThirdPartyResource
(
"foo"
))
}
func
TestList
(
t
*
testing
.
T
)
{
storage
,
server
:=
newStorage
(
t
)
defer
server
.
Terminate
(
t
)
test
:=
registrytest
.
New
(
t
,
storage
.
Store
)
test
:=
registrytest
.
New
(
t
,
storage
.
Store
)
.
ClusterScope
()
test
.
TestList
(
validNewThirdPartyResource
(
"foo"
))
}
func
TestWatch
(
t
*
testing
.
T
)
{
storage
,
server
:=
newStorage
(
t
)
defer
server
.
Terminate
(
t
)
test
:=
registrytest
.
New
(
t
,
storage
.
Store
)
test
:=
registrytest
.
New
(
t
,
storage
.
Store
)
.
ClusterScope
()
test
.
TestWatch
(
validNewThirdPartyResource
(
"foo"
),
// matching labels
...
...
pkg/registry/thirdpartyresource/strategy.go
View file @
e41d5047
...
...
@@ -45,7 +45,7 @@ var _ = rest.RESTCreateStrategy(Strategy)
var
_
=
rest
.
RESTUpdateStrategy
(
Strategy
)
func
(
strategy
)
NamespaceScoped
()
bool
{
return
tru
e
return
fals
e
}
func
(
strategy
)
PrepareForCreate
(
obj
runtime
.
Object
)
{
...
...
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