replace request.Context with context.Context
This commit is contained in:
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package localsubjectaccessreview
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
kapierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
@@ -41,7 +42,7 @@ func (r *REST) New() runtime.Object {
|
||||
return &authorizationapi.LocalSubjectAccessReview{}
|
||||
}
|
||||
|
||||
func (r *REST) Create(ctx genericapirequest.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, includeUninitialized bool) (runtime.Object, error) {
|
||||
func (r *REST) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, includeUninitialized bool) (runtime.Object, error) {
|
||||
localSubjectAccessReview, ok := obj.(*authorizationapi.LocalSubjectAccessReview)
|
||||
if !ok {
|
||||
return nil, kapierrors.NewBadRequest(fmt.Sprintf("not a LocaLocalSubjectAccessReview: %#v", obj))
|
||||
|
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package selfsubjectaccessreview
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
@@ -41,7 +42,7 @@ func (r *REST) New() runtime.Object {
|
||||
return &authorizationapi.SelfSubjectAccessReview{}
|
||||
}
|
||||
|
||||
func (r *REST) Create(ctx genericapirequest.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, includeUninitialized bool) (runtime.Object, error) {
|
||||
func (r *REST) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, includeUninitialized bool) (runtime.Object, error) {
|
||||
selfSAR, ok := obj.(*authorizationapi.SelfSubjectAccessReview)
|
||||
if !ok {
|
||||
return nil, apierrors.NewBadRequest(fmt.Sprintf("not a SelfSubjectAccessReview: %#v", obj))
|
||||
|
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package selfsubjectrulesreview
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
@@ -43,7 +44,7 @@ func (r *REST) New() runtime.Object {
|
||||
}
|
||||
|
||||
// Create attempts to get self subject rules in specific namespace.
|
||||
func (r *REST) Create(ctx genericapirequest.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, includeUninitialized bool) (runtime.Object, error) {
|
||||
func (r *REST) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, includeUninitialized bool) (runtime.Object, error) {
|
||||
selfSRR, ok := obj.(*authorizationapi.SelfSubjectRulesReview)
|
||||
if !ok {
|
||||
return nil, apierrors.NewBadRequest(fmt.Sprintf("not a SelfSubjectRulesReview: %#v", obj))
|
||||
|
@@ -17,7 +17,6 @@ go_library(
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||
"//vendor/k8s.io/apiserver/pkg/authorization/authorizer:go_default_library",
|
||||
"//vendor/k8s.io/apiserver/pkg/endpoints/request:go_default_library",
|
||||
"//vendor/k8s.io/apiserver/pkg/registry/rest:go_default_library",
|
||||
],
|
||||
)
|
||||
|
@@ -17,12 +17,12 @@ limitations under the License.
|
||||
package subjectaccessreview
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
kapierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apiserver/pkg/authorization/authorizer"
|
||||
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
|
||||
"k8s.io/apiserver/pkg/registry/rest"
|
||||
authorizationapi "k8s.io/kubernetes/pkg/apis/authorization"
|
||||
authorizationvalidation "k8s.io/kubernetes/pkg/apis/authorization/validation"
|
||||
@@ -41,7 +41,7 @@ func (r *REST) New() runtime.Object {
|
||||
return &authorizationapi.SubjectAccessReview{}
|
||||
}
|
||||
|
||||
func (r *REST) Create(ctx genericapirequest.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, includeUninitialized bool) (runtime.Object, error) {
|
||||
func (r *REST) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, includeUninitialized bool) (runtime.Object, error) {
|
||||
subjectAccessReview, ok := obj.(*authorizationapi.SubjectAccessReview)
|
||||
if !ok {
|
||||
return nil, kapierrors.NewBadRequest(fmt.Sprintf("not a SubjectAccessReview: %#v", obj))
|
||||
|
Reference in New Issue
Block a user