From 119f2208324b67d97795445f3fee2a667d6c5b41 Mon Sep 17 00:00:00 2001 From: Mike Danese Date: Mon, 10 Feb 2020 10:49:48 -0800 Subject: [PATCH 1/2] remove authn/z.CreateContext expansions --- hack/.golint_failures | 8 ---- .../kubernetes/typed/authentication/v1/BUILD | 1 - .../typed/authentication/v1/fake/BUILD | 1 - .../v1/fake/fake_tokenreview_expansion.go | 29 -------------- .../authentication/v1/generated_expansion.go | 2 + .../v1/tokenreview_expansion.go | 37 ------------------ .../typed/authentication/v1beta1/BUILD | 1 - .../typed/authentication/v1beta1/fake/BUILD | 1 - .../fake/fake_tokenreview_expansion.go | 29 -------------- .../v1beta1/generated_expansion.go | 2 + .../v1beta1/tokenreview_expansion.go | 37 ------------------ .../kubernetes/typed/authorization/v1/BUILD | 4 -- .../typed/authorization/v1/fake/BUILD | 4 -- ...fake_localsubjectaccessreview_expansion.go | 29 -------------- .../fake_selfsubjectaccessreview_expansion.go | 29 -------------- .../fake_selfsubjectrulesreview_expansion.go | 29 -------------- .../fake_subjectaccessreview_expansion.go | 32 ---------------- .../authorization/v1/generated_expansion.go | 8 ++++ .../v1/localsubjectaccessreview_expansion.go | 38 ------------------- .../v1/selfsubjectaccessreview_expansion.go | 37 ------------------ .../v1/selfsubjectrulesreview_expansion.go | 37 ------------------ .../v1/subjectaccessreview_expansion.go | 38 ------------------- .../typed/authorization/v1beta1/BUILD | 4 -- .../typed/authorization/v1beta1/fake/BUILD | 5 --- .../v1beta1/fake/fake_generated_expansion.go | 17 --------- ...fake_localsubjectaccessreview_expansion.go | 29 -------------- .../fake_selfsubjectaccessreview_expansion.go | 29 -------------- .../fake_selfsubjectrulesreview_expansion.go | 29 -------------- .../fake_subjectaccessreview_expansion.go | 29 -------------- .../v1beta1/generated_expansion.go | 8 ++++ .../localsubjectaccessreview_expansion.go | 38 ------------------- .../selfsubjectaccessreview_expansion.go | 37 ------------------ .../selfsubjectrulesreview_expansion.go | 37 ------------------ .../v1beta1/subjectaccessreview_expansion.go | 38 ------------------- 34 files changed, 20 insertions(+), 713 deletions(-) delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_generated_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview_expansion.go delete mode 100644 staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview_expansion.go diff --git a/hack/.golint_failures b/hack/.golint_failures index c55a62897da..cf19fa08e5d 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -406,14 +406,6 @@ staging/src/k8s.io/client-go/discovery/fake staging/src/k8s.io/client-go/dynamic staging/src/k8s.io/client-go/dynamic/fake staging/src/k8s.io/client-go/examples/workqueue -staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1 -staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/fake -staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1 -staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake -staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1 -staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake -staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1 -staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1beta1 staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake staging/src/k8s.io/client-go/kubernetes/typed/core/v1 diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/BUILD b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/BUILD index 9acc4a0a335..6de5022f3a3 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/BUILD +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/BUILD @@ -12,7 +12,6 @@ go_library( "doc.go", "generated_expansion.go", "tokenreview.go", - "tokenreview_expansion.go", ], importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1", importpath = "k8s.io/client-go/kubernetes/typed/authentication/v1", diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/BUILD b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/BUILD index 429e39473fd..ae3591ec046 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/BUILD +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/BUILD @@ -11,7 +11,6 @@ go_library( "doc.go", "fake_authentication_client.go", "fake_tokenreview.go", - "fake_tokenreview_expansion.go", ], importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake", importpath = "k8s.io/client-go/kubernetes/typed/authentication/v1/fake", diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview_expansion.go deleted file mode 100644 index 9f6bcf87505..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_tokenreview_expansion.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - "context" - - authenticationapi "k8s.io/api/authentication/v1" - core "k8s.io/client-go/testing" -) - -func (c *FakeTokenReviews) CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) { - obj, err := c.Fake.Invokes(core.NewRootCreateAction(authenticationapi.SchemeGroupVersion.WithResource("tokenreviews"), tokenReview), &authenticationapi.TokenReview{}) - return obj.(*authenticationapi.TokenReview), err -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/generated_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/generated_expansion.go index 177209ec619..0413fb2b665 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/generated_expansion.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/generated_expansion.go @@ -17,3 +17,5 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. package v1 + +type TokenReviewExpansion interface{} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview_expansion.go deleted file mode 100644 index 9f1851a2627..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview_expansion.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - "context" - - authenticationapi "k8s.io/api/authentication/v1" -) - -type TokenReviewExpansion interface { - CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) -} - -func (c *tokenReviews) CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) { - result = &authenticationapi.TokenReview{} - err = c.client.Post(). - Resource("tokenreviews"). - Body(tokenReview). - Do(ctx). - Into(result) - return -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/BUILD b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/BUILD index 174bc453257..d6255e5109d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/BUILD +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/BUILD @@ -12,7 +12,6 @@ go_library( "doc.go", "generated_expansion.go", "tokenreview.go", - "tokenreview_expansion.go", ], importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1", importpath = "k8s.io/client-go/kubernetes/typed/authentication/v1beta1", diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/BUILD b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/BUILD index 103e38e2056..3e6f85182b1 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/BUILD +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/BUILD @@ -11,7 +11,6 @@ go_library( "doc.go", "fake_authentication_client.go", "fake_tokenreview.go", - "fake_tokenreview_expansion.go", ], importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake", importpath = "k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake", diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview_expansion.go deleted file mode 100644 index 02df9724bfd..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview_expansion.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - "context" - - authenticationapi "k8s.io/api/authentication/v1beta1" - core "k8s.io/client-go/testing" -) - -func (c *FakeTokenReviews) CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) { - obj, err := c.Fake.Invokes(core.NewRootCreateAction(authenticationapi.SchemeGroupVersion.WithResource("tokenreviews"), tokenReview), &authenticationapi.TokenReview{}) - return obj.(*authenticationapi.TokenReview), err -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go index f6df7696326..60bf15ab996 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go @@ -17,3 +17,5 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. package v1beta1 + +type TokenReviewExpansion interface{} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview_expansion.go deleted file mode 100644 index b658503f583..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview_expansion.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - - authenticationapi "k8s.io/api/authentication/v1beta1" -) - -type TokenReviewExpansion interface { - CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) -} - -func (c *tokenReviews) CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) { - result = &authenticationapi.TokenReview{} - err = c.client.Post(). - Resource("tokenreviews"). - Body(tokenReview). - Do(ctx). - Into(result) - return -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/BUILD b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/BUILD index f6a071181d0..ec4ee12021c 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/BUILD +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/BUILD @@ -12,13 +12,9 @@ go_library( "doc.go", "generated_expansion.go", "localsubjectaccessreview.go", - "localsubjectaccessreview_expansion.go", "selfsubjectaccessreview.go", - "selfsubjectaccessreview_expansion.go", "selfsubjectrulesreview.go", - "selfsubjectrulesreview_expansion.go", "subjectaccessreview.go", - "subjectaccessreview_expansion.go", ], importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1", importpath = "k8s.io/client-go/kubernetes/typed/authorization/v1", diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/BUILD b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/BUILD index 969cea275cc..0a27a110985 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/BUILD +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/BUILD @@ -11,13 +11,9 @@ go_library( "doc.go", "fake_authorization_client.go", "fake_localsubjectaccessreview.go", - "fake_localsubjectaccessreview_expansion.go", "fake_selfsubjectaccessreview.go", - "fake_selfsubjectaccessreview_expansion.go", "fake_selfsubjectrulesreview.go", - "fake_selfsubjectrulesreview_expansion.go", "fake_subjectaccessreview.go", - "fake_subjectaccessreview_expansion.go", ], importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/fake", importpath = "k8s.io/client-go/kubernetes/typed/authorization/v1/fake", diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview_expansion.go deleted file mode 100644 index 75eaa4622b6..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview_expansion.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1" - core "k8s.io/client-go/testing" -) - -func (c *FakeLocalSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) { - obj, err := c.Fake.Invokes(core.NewCreateAction(authorizationapi.SchemeGroupVersion.WithResource("localsubjectaccessreviews"), c.ns, sar), &authorizationapi.SubjectAccessReview{}) - return obj.(*authorizationapi.LocalSubjectAccessReview), err -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview_expansion.go deleted file mode 100644 index d8c7f4abe87..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview_expansion.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1" - core "k8s.io/client-go/testing" -) - -func (c *FakeSelfSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) { - obj, err := c.Fake.Invokes(core.NewRootCreateAction(authorizationapi.SchemeGroupVersion.WithResource("selfsubjectaccessreviews"), sar), &authorizationapi.SelfSubjectAccessReview{}) - return obj.(*authorizationapi.SelfSubjectAccessReview), err -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview_expansion.go deleted file mode 100644 index 5e74950bee1..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview_expansion.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1" - core "k8s.io/client-go/testing" -) - -func (c *FakeSelfSubjectRulesReviews) CreateContext(ctx context.Context, srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) { - obj, err := c.Fake.Invokes(core.NewRootCreateAction(authorizationapi.SchemeGroupVersion.WithResource("selfsubjectrulesreviews"), srr), &authorizationapi.SelfSubjectRulesReview{}) - return obj.(*authorizationapi.SelfSubjectRulesReview), err -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview_expansion.go deleted file mode 100644 index 235c041b552..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview_expansion.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1" - core "k8s.io/client-go/testing" -) - -func (c *FakeSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) { - obj, err := c.Fake.Invokes(core.NewRootCreateAction(authorizationapi.SchemeGroupVersion.WithResource("subjectaccessreviews"), sar), &authorizationapi.SubjectAccessReview{}) - if obj == nil { - return nil, err - } - return obj.(*authorizationapi.SubjectAccessReview), err -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/generated_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/generated_expansion.go index 177209ec619..fe8c72cd4d2 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/generated_expansion.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/generated_expansion.go @@ -17,3 +17,11 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. package v1 + +type LocalSubjectAccessReviewExpansion interface{} + +type SelfSubjectAccessReviewExpansion interface{} + +type SelfSubjectRulesReviewExpansion interface{} + +type SubjectAccessReviewExpansion interface{} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview_expansion.go deleted file mode 100644 index 00ca4d9f743..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview_expansion.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1" -) - -type LocalSubjectAccessReviewExpansion interface { - CreateContext(ctx context.Context, sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) -} - -func (c *localSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) { - result = &authorizationapi.LocalSubjectAccessReview{} - err = c.client.Post(). - Namespace(c.ns). - Resource("localsubjectaccessreviews"). - Body(sar). - Do(ctx). - Into(result) - return -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview_expansion.go deleted file mode 100644 index 7b1de564155..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview_expansion.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1" -) - -type SelfSubjectAccessReviewExpansion interface { - CreateContext(ctx context.Context, sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) -} - -func (c *selfSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) { - result = &authorizationapi.SelfSubjectAccessReview{} - err = c.client.Post(). - Resource("selfsubjectaccessreviews"). - Body(sar). - Do(ctx). - Into(result) - return -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview_expansion.go deleted file mode 100644 index 5826f43930a..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview_expansion.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1" -) - -type SelfSubjectRulesReviewExpansion interface { - CreateContext(ctx context.Context, srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) -} - -func (c *selfSubjectRulesReviews) CreateContext(ctx context.Context, srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) { - result = &authorizationapi.SelfSubjectRulesReview{} - err = c.client.Post(). - Resource("selfsubjectrulesreviews"). - Body(srr). - Do(ctx). - Into(result) - return -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview_expansion.go deleted file mode 100644 index 07005966f8c..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview_expansion.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1" -) - -// The SubjectAccessReviewExpansion interface allows manually adding extra methods to the AuthorizationInterface. -type SubjectAccessReviewExpansion interface { - CreateContext(ctx context.Context, sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) -} - -func (c *subjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) { - result = &authorizationapi.SubjectAccessReview{} - err = c.client.Post(). - Resource("subjectaccessreviews"). - Body(sar). - Do(ctx). - Into(result) - return -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/BUILD b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/BUILD index 29a7979f604..e2904c06bdc 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/BUILD +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/BUILD @@ -12,13 +12,9 @@ go_library( "doc.go", "generated_expansion.go", "localsubjectaccessreview.go", - "localsubjectaccessreview_expansion.go", "selfsubjectaccessreview.go", - "selfsubjectaccessreview_expansion.go", "selfsubjectrulesreview.go", - "selfsubjectrulesreview_expansion.go", "subjectaccessreview.go", - "subjectaccessreview_expansion.go", ], importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1", importpath = "k8s.io/client-go/kubernetes/typed/authorization/v1beta1", diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/BUILD b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/BUILD index fc61d77816a..4f552fe52d5 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/BUILD +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/BUILD @@ -10,15 +10,10 @@ go_library( srcs = [ "doc.go", "fake_authorization_client.go", - "fake_generated_expansion.go", "fake_localsubjectaccessreview.go", - "fake_localsubjectaccessreview_expansion.go", "fake_selfsubjectaccessreview.go", - "fake_selfsubjectaccessreview_expansion.go", "fake_selfsubjectrulesreview.go", - "fake_selfsubjectrulesreview_expansion.go", "fake_subjectaccessreview.go", - "fake_subjectaccessreview_expansion.go", ], importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake", importpath = "k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake", diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_generated_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_generated_expansion.go deleted file mode 100644 index 8754e39d87c..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_generated_expansion.go +++ /dev/null @@ -1,17 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview_expansion.go deleted file mode 100644 index 44b60878dff..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview_expansion.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1beta1" - core "k8s.io/client-go/testing" -) - -func (c *FakeLocalSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) { - obj, err := c.Fake.Invokes(core.NewCreateAction(authorizationapi.SchemeGroupVersion.WithResource("localsubjectaccessreviews"), c.ns, sar), &authorizationapi.SubjectAccessReview{}) - return obj.(*authorizationapi.LocalSubjectAccessReview), err -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview_expansion.go deleted file mode 100644 index aaf1081459f..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview_expansion.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1beta1" - core "k8s.io/client-go/testing" -) - -func (c *FakeSelfSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) { - obj, err := c.Fake.Invokes(core.NewRootCreateAction(authorizationapi.SchemeGroupVersion.WithResource("selfsubjectaccessreviews"), sar), &authorizationapi.SelfSubjectAccessReview{}) - return obj.(*authorizationapi.SelfSubjectAccessReview), err -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview_expansion.go deleted file mode 100644 index e162e50e450..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview_expansion.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1beta1" - core "k8s.io/client-go/testing" -) - -func (c *FakeSelfSubjectRulesReviews) CreateContext(ctx context.Context, srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) { - obj, err := c.Fake.Invokes(core.NewRootCreateAction(authorizationapi.SchemeGroupVersion.WithResource("selfsubjectrulesreviews"), srr), &authorizationapi.SelfSubjectRulesReview{}) - return obj.(*authorizationapi.SelfSubjectRulesReview), err -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview_expansion.go deleted file mode 100644 index 7bb9d539014..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview_expansion.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1beta1" - core "k8s.io/client-go/testing" -) - -func (c *FakeSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) { - obj, err := c.Fake.Invokes(core.NewRootCreateAction(authorizationapi.SchemeGroupVersion.WithResource("subjectaccessreviews"), sar), &authorizationapi.SubjectAccessReview{}) - return obj.(*authorizationapi.SubjectAccessReview), err -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go index f6df7696326..ae2388301f0 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go @@ -17,3 +17,11 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. package v1beta1 + +type LocalSubjectAccessReviewExpansion interface{} + +type SelfSubjectAccessReviewExpansion interface{} + +type SelfSubjectRulesReviewExpansion interface{} + +type SubjectAccessReviewExpansion interface{} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview_expansion.go deleted file mode 100644 index 5040adaa5dd..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview_expansion.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1beta1" -) - -type LocalSubjectAccessReviewExpansion interface { - CreateContext(ctx context.Context, sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) -} - -func (c *localSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) { - result = &authorizationapi.LocalSubjectAccessReview{} - err = c.client.Post(). - Namespace(c.ns). - Resource("localsubjectaccessreviews"). - Body(sar). - Do(ctx). - Into(result) - return -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview_expansion.go deleted file mode 100644 index 28d733b7bc9..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview_expansion.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1beta1" -) - -type SelfSubjectAccessReviewExpansion interface { - CreateContext(ctx context.Context, sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) -} - -func (c *selfSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) { - result = &authorizationapi.SelfSubjectAccessReview{} - err = c.client.Post(). - Resource("selfsubjectaccessreviews"). - Body(sar). - Do(ctx). - Into(result) - return -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview_expansion.go deleted file mode 100644 index 7a211dae4c0..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview_expansion.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1beta1" -) - -type SelfSubjectRulesReviewExpansion interface { - CreateContext(ctx context.Context, srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) -} - -func (c *selfSubjectRulesReviews) CreateContext(ctx context.Context, srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) { - result = &authorizationapi.SelfSubjectRulesReview{} - err = c.client.Post(). - Resource("selfsubjectrulesreviews"). - Body(srr). - Do(ctx). - Into(result) - return -} diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview_expansion.go deleted file mode 100644 index ea7a0b8ec0c..00000000000 --- a/staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview_expansion.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1beta1" -) - -// The SubjectAccessReviewExpansion interface allows manually adding extra methods to the AuthorizationInterface. -type SubjectAccessReviewExpansion interface { - CreateContext(ctx context.Context, sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) -} - -func (c *subjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) { - result = &authorizationapi.SubjectAccessReview{} - err = c.client.Post(). - Resource("subjectaccessreviews"). - Body(sar). - Do(ctx). - Into(result) - return -} From 5954f34ade6b56d996ceaa46d403bbf07a164b9b Mon Sep 17 00:00:00 2001 From: Mike Danese Date: Mon, 10 Feb 2020 10:57:24 -0800 Subject: [PATCH 2/2] migrate authenticator and authorizer to Create --- .../plugin/pkg/authenticator/token/webhook/BUILD | 1 + .../plugin/pkg/authenticator/token/webhook/webhook.go | 9 +++++---- .../k8s.io/apiserver/plugin/pkg/authorizer/webhook/BUILD | 1 + .../apiserver/plugin/pkg/authorizer/webhook/webhook.go | 9 +++++---- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/BUILD b/staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/BUILD index e374e481bd7..dc2839f18d2 100644 --- a/staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/BUILD +++ b/staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/BUILD @@ -36,6 +36,7 @@ go_library( deps = [ "//staging/src/k8s.io/api/authentication/v1:go_default_library", "//staging/src/k8s.io/api/authentication/v1beta1:go_default_library", + "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//staging/src/k8s.io/apiserver/pkg/authentication/authenticator:go_default_library", diff --git a/staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/webhook.go b/staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/webhook.go index 1912959e5ae..7410d1959ed 100644 --- a/staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/webhook.go +++ b/staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/webhook/webhook.go @@ -25,6 +25,7 @@ import ( authenticationv1 "k8s.io/api/authentication/v1" authenticationv1beta1 "k8s.io/api/authentication/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apiserver/pkg/authentication/authenticator" @@ -41,7 +42,7 @@ const retryBackoff = 500 * time.Millisecond var _ authenticator.Token = (*WebhookTokenAuthenticator)(nil) type tokenReviewer interface { - CreateContext(ctx context.Context, review *authenticationv1.TokenReview) (*authenticationv1.TokenReview, error) + Create(ctx context.Context, review *authenticationv1.TokenReview, _ metav1.CreateOptions) (*authenticationv1.TokenReview, error) } type WebhookTokenAuthenticator struct { @@ -101,7 +102,7 @@ func (w *WebhookTokenAuthenticator) AuthenticateToken(ctx context.Context, token auds authenticator.Audiences ) webhook.WithExponentialBackoff(ctx, w.initialBackoff, func() error { - result, err = w.tokenReview.CreateContext(ctx, r) + result, err = w.tokenReview.Create(ctx, r, metav1.CreateOptions{}) return err }, webhook.DefaultShouldRetry) if err != nil { @@ -196,7 +197,7 @@ type tokenReviewV1Client struct { w *webhook.GenericWebhook } -func (t *tokenReviewV1Client) CreateContext(ctx context.Context, review *authenticationv1.TokenReview) (*authenticationv1.TokenReview, error) { +func (t *tokenReviewV1Client) Create(ctx context.Context, review *authenticationv1.TokenReview, _ metav1.CreateOptions) (*authenticationv1.TokenReview, error) { result := &authenticationv1.TokenReview{} err := t.w.RestClient.Post().Body(review).Do(ctx).Into(result) return result, err @@ -206,7 +207,7 @@ type tokenReviewV1beta1Client struct { w *webhook.GenericWebhook } -func (t *tokenReviewV1beta1Client) CreateContext(ctx context.Context, review *authenticationv1.TokenReview) (*authenticationv1.TokenReview, error) { +func (t *tokenReviewV1beta1Client) Create(ctx context.Context, review *authenticationv1.TokenReview, _ metav1.CreateOptions) (*authenticationv1.TokenReview, error) { v1beta1Review := &authenticationv1beta1.TokenReview{Spec: v1SpecToV1beta1Spec(&review.Spec)} v1beta1Result := &authenticationv1beta1.TokenReview{} err := t.w.RestClient.Post().Body(v1beta1Review).Do(ctx).Into(v1beta1Result) diff --git a/staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/BUILD b/staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/BUILD index 2c15fa97631..b3208931c75 100644 --- a/staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/BUILD +++ b/staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/BUILD @@ -35,6 +35,7 @@ go_library( deps = [ "//staging/src/k8s.io/api/authorization/v1:go_default_library", "//staging/src/k8s.io/api/authorization/v1beta1:go_default_library", + "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/cache:go_default_library", diff --git a/staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook.go b/staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook.go index fecf7aab8e8..cc8b5e78bc6 100644 --- a/staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook.go +++ b/staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook.go @@ -27,6 +27,7 @@ import ( authorizationv1 "k8s.io/api/authorization/v1" authorizationv1beta1 "k8s.io/api/authorization/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/cache" @@ -47,7 +48,7 @@ const ( var _ authorizer.Authorizer = (*WebhookAuthorizer)(nil) type subjectAccessReviewer interface { - CreateContext(context.Context, *authorizationv1.SubjectAccessReview) (*authorizationv1.SubjectAccessReview, error) + Create(context.Context, *authorizationv1.SubjectAccessReview, metav1.CreateOptions) (*authorizationv1.SubjectAccessReview, error) } type WebhookAuthorizer struct { @@ -189,7 +190,7 @@ func (w *WebhookAuthorizer) Authorize(ctx context.Context, attr authorizer.Attri err error ) webhook.WithExponentialBackoff(ctx, w.initialBackoff, func() error { - result, err = w.subjectAccessReview.CreateContext(ctx, r) + result, err = w.subjectAccessReview.Create(ctx, r, metav1.CreateOptions{}) return err }, webhook.DefaultShouldRetry) if err != nil { @@ -287,7 +288,7 @@ type subjectAccessReviewV1Client struct { w *webhook.GenericWebhook } -func (t *subjectAccessReviewV1Client) CreateContext(ctx context.Context, subjectAccessReview *authorizationv1.SubjectAccessReview) (*authorizationv1.SubjectAccessReview, error) { +func (t *subjectAccessReviewV1Client) Create(ctx context.Context, subjectAccessReview *authorizationv1.SubjectAccessReview, _ metav1.CreateOptions) (*authorizationv1.SubjectAccessReview, error) { result := &authorizationv1.SubjectAccessReview{} err := t.w.RestClient.Post().Body(subjectAccessReview).Do(ctx).Into(result) return result, err @@ -297,7 +298,7 @@ type subjectAccessReviewV1beta1Client struct { w *webhook.GenericWebhook } -func (t *subjectAccessReviewV1beta1Client) CreateContext(ctx context.Context, subjectAccessReview *authorizationv1.SubjectAccessReview) (*authorizationv1.SubjectAccessReview, error) { +func (t *subjectAccessReviewV1beta1Client) Create(ctx context.Context, subjectAccessReview *authorizationv1.SubjectAccessReview, _ metav1.CreateOptions) (*authorizationv1.SubjectAccessReview, error) { v1beta1Review := &authorizationv1beta1.SubjectAccessReview{Spec: v1SpecToV1beta1Spec(&subjectAccessReview.Spec)} v1beta1Result := &authorizationv1beta1.SubjectAccessReview{} err := t.w.RestClient.Post().Body(v1beta1Review).Do(ctx).Into(v1beta1Result)