mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 16:29:21 +00:00
Svc REST: Add stub begin* hooks
These will be used in the next set of commits to de-0layer service REST.
This commit is contained in:
parent
f3c7e846f1
commit
5e7e35ca45
@ -89,6 +89,8 @@ func NewGenericREST(optsGetter generic.RESTOptionsGetter, serviceCIDR net.IPNet,
|
|||||||
}
|
}
|
||||||
genericStore := &GenericREST{store, primaryIPFamily, secondaryFamily}
|
genericStore := &GenericREST{store, primaryIPFamily, secondaryFamily}
|
||||||
store.Decorator = genericStore.defaultOnRead
|
store.Decorator = genericStore.defaultOnRead
|
||||||
|
store.BeginCreate = genericStore.beginCreate
|
||||||
|
store.BeginUpdate = genericStore.beginUpdate
|
||||||
|
|
||||||
return genericStore, &StatusREST{store: &statusStore}, nil
|
return genericStore, &StatusREST{store: &statusStore}, nil
|
||||||
}
|
}
|
||||||
@ -240,3 +242,37 @@ func (r *GenericREST) defaultOnReadService(service *api.Service) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *GenericREST) beginCreate(ctx context.Context, obj runtime.Object, options *metav1.CreateOptions) (genericregistry.FinishFunc, error) {
|
||||||
|
svc := obj.(*api.Service)
|
||||||
|
|
||||||
|
// FIXME: remove this when implementing
|
||||||
|
_ = svc
|
||||||
|
|
||||||
|
// Our cleanup callback
|
||||||
|
finish := func(_ context.Context, success bool) {
|
||||||
|
if success {
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return finish, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *GenericREST) beginUpdate(ctx context.Context, obj, oldObj runtime.Object, options *metav1.UpdateOptions) (genericregistry.FinishFunc, error) {
|
||||||
|
newSvc := obj.(*api.Service)
|
||||||
|
oldSvc := oldObj.(*api.Service)
|
||||||
|
|
||||||
|
// FIXME: remove these when implementing
|
||||||
|
_ = oldSvc
|
||||||
|
_ = newSvc
|
||||||
|
|
||||||
|
// Our cleanup callback
|
||||||
|
finish := func(_ context.Context, success bool) {
|
||||||
|
if success {
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return finish, nil
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user