Move pkg/api.{Context,RequestContextMapper} into pkg/genericapiserver/api/request

This commit is contained in:
Dr. Stefan Schimanski
2017-01-02 15:07:36 +01:00
parent 2d58ffc129
commit 87dd990bb7
265 changed files with 1256 additions and 1043 deletions

View File

@@ -23,6 +23,7 @@ import (
endptspkg "k8s.io/kubernetes/pkg/api/endpoints"
"k8s.io/kubernetes/pkg/api/validation"
"k8s.io/kubernetes/pkg/fields"
genericapirequest "k8s.io/kubernetes/pkg/genericapiserver/api/request"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/registry/generic"
"k8s.io/kubernetes/pkg/runtime"
@@ -46,15 +47,15 @@ func (endpointsStrategy) NamespaceScoped() bool {
}
// PrepareForCreate clears fields that are not allowed to be set by end users on creation.
func (endpointsStrategy) PrepareForCreate(ctx api.Context, obj runtime.Object) {
func (endpointsStrategy) PrepareForCreate(ctx genericapirequest.Context, obj runtime.Object) {
}
// PrepareForUpdate clears fields that are not allowed to be set by end users on update.
func (endpointsStrategy) PrepareForUpdate(ctx api.Context, obj, old runtime.Object) {
func (endpointsStrategy) PrepareForUpdate(ctx genericapirequest.Context, obj, old runtime.Object) {
}
// Validate validates a new endpoints.
func (endpointsStrategy) Validate(ctx api.Context, obj runtime.Object) field.ErrorList {
func (endpointsStrategy) Validate(ctx genericapirequest.Context, obj runtime.Object) field.ErrorList {
return validation.ValidateEndpoints(obj.(*api.Endpoints))
}
@@ -70,7 +71,7 @@ func (endpointsStrategy) AllowCreateOnUpdate() bool {
}
// ValidateUpdate is the default update validation for an end user.
func (endpointsStrategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) field.ErrorList {
func (endpointsStrategy) ValidateUpdate(ctx genericapirequest.Context, obj, old runtime.Object) field.ErrorList {
errorList := validation.ValidateEndpoints(obj.(*api.Endpoints))
return append(errorList, validation.ValidateEndpointsUpdate(obj.(*api.Endpoints), old.(*api.Endpoints))...)
}