KEP-3325: Promote SelfSubjectReview to GA

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

Kubernetes-commit: 40de26dcff80f29380a4ba90a93ce3ece7482b78
This commit is contained in:
m.nabokikh 2023-05-02 01:26:20 +02:00 committed by Kubernetes Publisher
parent bea472626f
commit 8009187f26
5 changed files with 121 additions and 0 deletions

View File

@ -28,6 +28,7 @@ import (
type AuthenticationV1Interface interface { type AuthenticationV1Interface interface {
RESTClient() rest.Interface RESTClient() rest.Interface
SelfSubjectReviewsGetter
TokenReviewsGetter TokenReviewsGetter
} }
@ -36,6 +37,10 @@ type AuthenticationV1Client struct {
restClient rest.Interface restClient rest.Interface
} }
func (c *AuthenticationV1Client) SelfSubjectReviews() SelfSubjectReviewInterface {
return newSelfSubjectReviews(c)
}
func (c *AuthenticationV1Client) TokenReviews() TokenReviewInterface { func (c *AuthenticationV1Client) TokenReviews() TokenReviewInterface {
return newTokenReviews(c) return newTokenReviews(c)
} }

View File

@ -28,6 +28,10 @@ type FakeAuthenticationV1 struct {
*testing.Fake *testing.Fake
} }
func (c *FakeAuthenticationV1) SelfSubjectReviews() v1.SelfSubjectReviewInterface {
return &FakeSelfSubjectReviews{c}
}
func (c *FakeAuthenticationV1) TokenReviews() v1.TokenReviewInterface { func (c *FakeAuthenticationV1) TokenReviews() v1.TokenReviewInterface {
return &FakeTokenReviews{c} return &FakeTokenReviews{c}
} }

View File

@ -0,0 +1,46 @@
/*
Copyright 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1 "k8s.io/api/authentication/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
testing "k8s.io/client-go/testing"
)
// FakeSelfSubjectReviews implements SelfSubjectReviewInterface
type FakeSelfSubjectReviews struct {
Fake *FakeAuthenticationV1
}
var selfsubjectreviewsResource = v1.SchemeGroupVersion.WithResource("selfsubjectreviews")
var selfsubjectreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectReview")
// Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any.
func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1.SelfSubjectReview, opts metav1.CreateOptions) (result *v1.SelfSubjectReview, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(selfsubjectreviewsResource, selfSubjectReview), &v1.SelfSubjectReview{})
if obj == nil {
return nil, err
}
return obj.(*v1.SelfSubjectReview), err
}

View File

@ -18,4 +18,6 @@ limitations under the License.
package v1 package v1
type SelfSubjectReviewExpansion interface{}
type TokenReviewExpansion interface{} type TokenReviewExpansion interface{}

View File

@ -0,0 +1,64 @@
/*
Copyright 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1
import (
"context"
v1 "k8s.io/api/authentication/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
// SelfSubjectReviewsGetter has a method to return a SelfSubjectReviewInterface.
// A group's client should implement this interface.
type SelfSubjectReviewsGetter interface {
SelfSubjectReviews() SelfSubjectReviewInterface
}
// SelfSubjectReviewInterface has methods to work with SelfSubjectReview resources.
type SelfSubjectReviewInterface interface {
Create(ctx context.Context, selfSubjectReview *v1.SelfSubjectReview, opts metav1.CreateOptions) (*v1.SelfSubjectReview, error)
SelfSubjectReviewExpansion
}
// selfSubjectReviews implements SelfSubjectReviewInterface
type selfSubjectReviews struct {
client rest.Interface
}
// newSelfSubjectReviews returns a SelfSubjectReviews
func newSelfSubjectReviews(c *AuthenticationV1Client) *selfSubjectReviews {
return &selfSubjectReviews{
client: c.RESTClient(),
}
}
// Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any.
func (c *selfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1.SelfSubjectReview, opts metav1.CreateOptions) (result *v1.SelfSubjectReview, err error) {
result = &v1.SelfSubjectReview{}
err = c.client.Post().
Resource("selfsubjectreviews").
VersionedParams(&opts, scheme.ParameterCodec).
Body(selfSubjectReview).
Do(ctx).
Into(result)
return
}