mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 22:20:18 +00:00
Add context object to interfaces
This commit is contained in:
@@ -19,6 +19,8 @@ package endpoint
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"code.google.com/p/go.net/context"
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
|
||||
@@ -38,12 +40,12 @@ func NewREST(registry Registry) *REST {
|
||||
}
|
||||
|
||||
// Get satisfies the RESTStorage interface.
|
||||
func (rs *REST) Get(id string) (runtime.Object, error) {
|
||||
func (rs *REST) Get(ctx context.Context, id string) (runtime.Object, error) {
|
||||
return rs.registry.GetEndpoints(id)
|
||||
}
|
||||
|
||||
// List satisfies the RESTStorage interface.
|
||||
func (rs *REST) List(label, field labels.Selector) (runtime.Object, error) {
|
||||
func (rs *REST) List(ctx context.Context, label, field labels.Selector) (runtime.Object, error) {
|
||||
if !label.Empty() || !field.Empty() {
|
||||
return nil, errors.New("label/field selectors are not supported on endpoints")
|
||||
}
|
||||
@@ -52,22 +54,22 @@ func (rs *REST) List(label, field labels.Selector) (runtime.Object, error) {
|
||||
|
||||
// Watch returns Endpoint events via a watch.Interface.
|
||||
// It implements apiserver.ResourceWatcher.
|
||||
func (rs *REST) Watch(label, field labels.Selector, resourceVersion uint64) (watch.Interface, error) {
|
||||
func (rs *REST) Watch(ctx context.Context, label, field labels.Selector, resourceVersion uint64) (watch.Interface, error) {
|
||||
return rs.registry.WatchEndpoints(label, field, resourceVersion)
|
||||
}
|
||||
|
||||
// Create satisfies the RESTStorage interface but is unimplemented.
|
||||
func (rs *REST) Create(obj runtime.Object) (<-chan runtime.Object, error) {
|
||||
func (rs *REST) Create(ctx context.Context, obj runtime.Object) (<-chan runtime.Object, error) {
|
||||
return nil, errors.New("unimplemented")
|
||||
}
|
||||
|
||||
// Update satisfies the RESTStorage interface but is unimplemented.
|
||||
func (rs *REST) Update(obj runtime.Object) (<-chan runtime.Object, error) {
|
||||
func (rs *REST) Update(ctx context.Context, obj runtime.Object) (<-chan runtime.Object, error) {
|
||||
return nil, errors.New("unimplemented")
|
||||
}
|
||||
|
||||
// Delete satisfies the RESTStorage interface but is unimplemented.
|
||||
func (rs *REST) Delete(id string) (<-chan runtime.Object, error) {
|
||||
func (rs *REST) Delete(ctx context.Context, id string) (<-chan runtime.Object, error) {
|
||||
return nil, errors.New("unimplemented")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user