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
926bb4cc
Commit
926bb4cc
authored
Jun 15, 2016
by
saadali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add patch status to Node internalclientset
parent
e3e919ca
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
2 deletions
+86
-2
fake_node_expansion.go
...entset/typed/core/unversioned/fake/fake_node_expansion.go
+32
-0
generated_expansion.go
...alclientset/typed/core/unversioned/generated_expansion.go
+0
-2
node_expansion.go
...nternalclientset/typed/core/unversioned/node_expansion.go
+40
-0
actions.go
pkg/client/testing/core/actions.go
+9
-0
nodecontroller_test.go
pkg/controller/node/nodecontroller_test.go
+5
-0
No files found.
pkg/client/clientset_generated/internalclientset/typed/core/unversioned/fake/fake_node_expansion.go
0 → 100644
View file @
926bb4cc
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
fake
import
(
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/testing/core"
)
func
(
c
*
FakeNodes
)
PatchStatus
(
nodeName
string
,
data
[]
byte
)
(
*
api
.
Node
,
error
)
{
obj
,
err
:=
c
.
Fake
.
Invokes
(
core
.
NewPatchSubresourceAction
(
nodesResource
,
"status"
),
&
api
.
Node
{})
if
obj
==
nil
{
return
nil
,
err
}
return
obj
.
(
*
api
.
Node
),
err
}
pkg/client/clientset_generated/internalclientset/typed/core/unversioned/generated_expansion.go
View file @
926bb4cc
...
@@ -22,8 +22,6 @@ type EndpointsExpansion interface{}
...
@@ -22,8 +22,6 @@ type EndpointsExpansion interface{}
type
LimitRangeExpansion
interface
{}
type
LimitRangeExpansion
interface
{}
type
NodeExpansion
interface
{}
type
PersistentVolumeExpansion
interface
{}
type
PersistentVolumeExpansion
interface
{}
type
PersistentVolumeClaimExpansion
interface
{}
type
PersistentVolumeClaimExpansion
interface
{}
...
...
pkg/client/clientset_generated/internalclientset/typed/core/unversioned/node_expansion.go
0 → 100644
View file @
926bb4cc
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
unversioned
import
"k8s.io/kubernetes/pkg/api"
// The NodeExpansion interface allows manually adding extra methods to the NodeInterface.
type
NodeExpansion
interface
{
// PatchStatus modifies the status of an existing node. It returns the copy
// of the node that the server returns, or an error.
PatchStatus
(
nodeName
string
,
data
[]
byte
)
(
*
api
.
Node
,
error
)
}
// PatchStatus modifies the status of an existing node. It returns the copy of
// the node that the server returns, or an error.
func
(
c
*
nodes
)
PatchStatus
(
nodeName
string
,
data
[]
byte
)
(
*
api
.
Node
,
error
)
{
result
:=
&
api
.
Node
{}
err
:=
c
.
client
.
Patch
(
api
.
StrategicMergePatchType
)
.
Resource
(
"nodes"
)
.
Name
(
nodeName
)
.
SubResource
(
"status"
)
.
Body
(
data
)
.
Do
()
.
Into
(
result
)
return
result
,
err
}
pkg/client/testing/core/actions.go
View file @
926bb4cc
...
@@ -137,6 +137,15 @@ func NewPatchAction(resource unversioned.GroupVersionResource, namespace string,
...
@@ -137,6 +137,15 @@ func NewPatchAction(resource unversioned.GroupVersionResource, namespace string,
return
action
return
action
}
}
func
NewPatchSubresourceAction
(
resource
unversioned
.
GroupVersionResource
,
subresource
string
)
PatchActionImpl
{
action
:=
PatchActionImpl
{}
action
.
Verb
=
"patch"
action
.
Resource
=
resource
action
.
Subresource
=
subresource
return
action
}
func
NewRootUpdateSubresourceAction
(
resource
unversioned
.
GroupVersionResource
,
subresource
string
,
object
runtime
.
Object
)
UpdateActionImpl
{
func
NewRootUpdateSubresourceAction
(
resource
unversioned
.
GroupVersionResource
,
subresource
string
,
object
runtime
.
Object
)
UpdateActionImpl
{
action
:=
UpdateActionImpl
{}
action
:=
UpdateActionImpl
{}
action
.
Verb
=
"update"
action
.
Verb
=
"update"
...
...
pkg/controller/node/nodecontroller_test.go
View file @
926bb4cc
...
@@ -157,6 +157,11 @@ func (m *FakeNodeHandler) UpdateStatus(node *api.Node) (*api.Node, error) {
...
@@ -157,6 +157,11 @@ func (m *FakeNodeHandler) UpdateStatus(node *api.Node) (*api.Node, error) {
return
node
,
nil
return
node
,
nil
}
}
func
(
m
*
FakeNodeHandler
)
PatchStatus
(
nodeName
string
,
data
[]
byte
)
(
*
api
.
Node
,
error
)
{
m
.
RequestCount
++
return
&
api
.
Node
{},
nil
}
func
(
m
*
FakeNodeHandler
)
Watch
(
opts
api
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
func
(
m
*
FakeNodeHandler
)
Watch
(
opts
api
.
ListOptions
)
(
watch
.
Interface
,
error
)
{
return
nil
,
nil
return
nil
,
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