Move pkg/api.{Context,RequestContextMapper} into pkg/genericapiserver/api/request
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/errors"
|
||||
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||
genericapirequest "k8s.io/kubernetes/pkg/genericapiserver/api/request"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@@ -58,13 +59,13 @@ func (r *NodeRegistry) SetError(err error) {
|
||||
r.Err = err
|
||||
}
|
||||
|
||||
func (r *NodeRegistry) ListNodes(ctx api.Context, options *api.ListOptions) (*api.NodeList, error) {
|
||||
func (r *NodeRegistry) ListNodes(ctx genericapirequest.Context, options *api.ListOptions) (*api.NodeList, error) {
|
||||
r.Lock()
|
||||
defer r.Unlock()
|
||||
return &r.Nodes, r.Err
|
||||
}
|
||||
|
||||
func (r *NodeRegistry) CreateNode(ctx api.Context, node *api.Node) error {
|
||||
func (r *NodeRegistry) CreateNode(ctx genericapirequest.Context, node *api.Node) error {
|
||||
r.Lock()
|
||||
defer r.Unlock()
|
||||
r.Node = node.Name
|
||||
@@ -72,7 +73,7 @@ func (r *NodeRegistry) CreateNode(ctx api.Context, node *api.Node) error {
|
||||
return r.Err
|
||||
}
|
||||
|
||||
func (r *NodeRegistry) UpdateNode(ctx api.Context, node *api.Node) error {
|
||||
func (r *NodeRegistry) UpdateNode(ctx genericapirequest.Context, node *api.Node) error {
|
||||
r.Lock()
|
||||
defer r.Unlock()
|
||||
for i, item := range r.Nodes.Items {
|
||||
@@ -84,7 +85,7 @@ func (r *NodeRegistry) UpdateNode(ctx api.Context, node *api.Node) error {
|
||||
return r.Err
|
||||
}
|
||||
|
||||
func (r *NodeRegistry) GetNode(ctx api.Context, nodeID string, options *metav1.GetOptions) (*api.Node, error) {
|
||||
func (r *NodeRegistry) GetNode(ctx genericapirequest.Context, nodeID string, options *metav1.GetOptions) (*api.Node, error) {
|
||||
r.Lock()
|
||||
defer r.Unlock()
|
||||
if r.Err != nil {
|
||||
@@ -98,7 +99,7 @@ func (r *NodeRegistry) GetNode(ctx api.Context, nodeID string, options *metav1.G
|
||||
return nil, errors.NewNotFound(api.Resource("nodes"), nodeID)
|
||||
}
|
||||
|
||||
func (r *NodeRegistry) DeleteNode(ctx api.Context, nodeID string) error {
|
||||
func (r *NodeRegistry) DeleteNode(ctx genericapirequest.Context, nodeID string) error {
|
||||
r.Lock()
|
||||
defer r.Unlock()
|
||||
var newList []api.Node
|
||||
@@ -111,6 +112,6 @@ func (r *NodeRegistry) DeleteNode(ctx api.Context, nodeID string) error {
|
||||
return r.Err
|
||||
}
|
||||
|
||||
func (r *NodeRegistry) WatchNodes(ctx api.Context, options *api.ListOptions) (watch.Interface, error) {
|
||||
func (r *NodeRegistry) WatchNodes(ctx genericapirequest.Context, options *api.ListOptions) (watch.Interface, error) {
|
||||
return nil, r.Err
|
||||
}
|
||||
|
Reference in New Issue
Block a user