Skip to content

WIP: Integration of certmanager for IntegrationSink #7088

WIP: Integration of certmanager for IntegrationSink

WIP: Integration of certmanager for IntegrationSink #7088

Triggered via pull request February 17, 2025 15:36
Status Failure
Total duration 4m 29s
Artifacts

knative-verify.yaml

on: pull_request
verify  /  Verify Deps and Codegen
4m 15s
verify / Verify Deps and Codegen
Fit to window
Zoom out
Zoom in

Annotations

10 errors and 1 warning
verify / Verify Deps and Codegen: pkg/client/certmanager/clientset/versioned/fake/clientset_generated.go#L1
Please run ./hack/update-codegen.sh. diff --git a/pkg/client/certmanager/clientset/versioned/fake/clientset_generated.go b/pkg/client/certmanager/clientset/versioned/fake/clientset_generated.go index 417cffb..2b59b09 100644 --- a/pkg/client/certmanager/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/certmanager/clientset/versioned/fake/clientset_generated.go @@ -33,8 +33,12 @@ import ( // NewSimpleClientset returns a clientset that will respond with the provided objects. // It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement +// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement // for a real clientset and is mostly useful in simple unit tests. +// +// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves +// server side apply testing. NewClientset is only available when apply configurations are generated (e.g. +// via --with-applyconfig). func NewSimpleClientset(objects ...runtime.Object) *Clientset { o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) for _, obj := range objects {
verify / Verify Deps and Codegen: pkg/client/certmanager/clientset/versioned/typed/acme/v1/challenge.go#L1
Please run ./hack/update-codegen.sh. diff --git a/pkg/client/certmanager/clientset/versioned/typed/acme/v1/challenge.go b/pkg/client/certmanager/clientset/versioned/typed/acme/v1/challenge.go index e8a0f26..e4c9af2 100644 --- a/pkg/client/certmanager/clientset/versioned/typed/acme/v1/challenge.go +++ b/pkg/client/certmanager/clientset/versioned/typed/acme/v1/challenge.go @@ -20,13 +20,12 @@ package v1 import ( "context" - "time" v1 "github.com/cert-manager/cert-manager/pkg/apis/acme/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" scheme "knative.dev/eventing/pkg/client/certmanager/clientset/versioned/scheme" ) @@ -40,6 +39,7 @@ type ChallengesGetter interface { type ChallengeInterface interface { Create(ctx context.Context, challenge *v1.Challenge, opts metav1.CreateOptions) (*v1.Challenge, error) Update(ctx context.Context, challenge *v1.Challenge, opts metav1.UpdateOptions) (*v1.Challenge, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, challenge *v1.Challenge, opts metav1.UpdateOptions) (*v1.Challenge, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -52,144 +52,18 @@ type ChallengeInterface interface { // challenges implements ChallengeInterface type challenges struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.Challenge, *v1.ChallengeList] } // newChallenges returns a Challenges func newChallenges(c *AcmeV1Client, namespace string) *challenges { return &challenges{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.Challenge, *v1.ChallengeList]( + "challenges", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.Challenge { return &v1.Challenge{} }, + func() *v1.ChallengeList { return &v1.ChallengeList{} }), } } - -// Get takes name of the challenge, and returns the corresponding challenge object, and an error if there is any. -func (c *challenges) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Challenge, err error) { - result = &v1.Challenge{} - err = c.client.Get(). - Namespace(c.ns). - Resource("challenges"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Challenges that match those selectors. -func (c *challenges) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ChallengeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ChallengeList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("challenges"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested challenges. -func (c *challenges) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("challenges"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a challenge and creates it. Returns the server's representation of the challenge, and an error, if there is any. -func (c *challenges) Create(ctx context.Context, challenge *v1.Challenge, opts metav1.CreateOptions) (result *v1.Challenge, err error) { - result = &v1.Challenge{} - err = c.client.Post(). - Namespace(c.ns). - Resource("challenges"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(challenge
verify / Verify Deps and Codegen: pkg/client/certmanager/clientset/versioned/typed/acme/v1/fake/fake_challenge.go#L1
Please run ./hack/update-codegen.sh. diff --git a/pkg/client/certmanager/clientset/versioned/typed/acme/v1/fake/fake_challenge.go b/pkg/client/certmanager/clientset/versioned/typed/acme/v1/fake/fake_challenge.go index 02f6a0f..7950991 100644 --- a/pkg/client/certmanager/clientset/versioned/typed/acme/v1/fake/fake_challenge.go +++ b/pkg/client/certmanager/clientset/versioned/typed/acme/v1/fake/fake_challenge.go @@ -41,22 +41,24 @@ var challengesKind = v1.SchemeGroupVersion.WithKind("Challenge") // Get takes name of the challenge, and returns the corresponding challenge object, and an error if there is any. func (c *FakeChallenges) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Challenge, err error) { + emptyResult := &v1.Challenge{} obj, err := c.Fake. - Invokes(testing.NewGetAction(challengesResource, c.ns, name), &v1.Challenge{}) + Invokes(testing.NewGetActionWithOptions(challengesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Challenge), err } // List takes label and field selectors, and returns the list of Challenges that match those selectors. func (c *FakeChallenges) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ChallengeList, err error) { + emptyResult := &v1.ChallengeList{} obj, err := c.Fake. - Invokes(testing.NewListAction(challengesResource, challengesKind, c.ns, opts), &v1.ChallengeList{}) + Invokes(testing.NewListActionWithOptions(challengesResource, challengesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -75,40 +77,43 @@ func (c *FakeChallenges) List(ctx context.Context, opts metav1.ListOptions) (res // Watch returns a watch.Interface that watches the requested challenges. func (c *FakeChallenges) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(challengesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(challengesResource, c.ns, opts)) } // Create takes the representation of a challenge and creates it. Returns the server's representation of the challenge, and an error, if there is any. func (c *FakeChallenges) Create(ctx context.Context, challenge *v1.Challenge, opts metav1.CreateOptions) (result *v1.Challenge, err error) { + emptyResult := &v1.Challenge{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(challengesResource, c.ns, challenge), &v1.Challenge{}) + Invokes(testing.NewCreateActionWithOptions(challengesResource, c.ns, challenge, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Challenge), err } // Update takes the representation of a challenge and updates it. Returns the server's representation of the challenge, and an error, if there is any. func (c *FakeChallenges) Update(ctx context.Context, challenge *v1.Challenge, opts metav1.UpdateOptions) (result *v1.Challenge, err error) { + emptyResult := &v1.Challenge{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(challengesResource, c.ns, challenge), &v1.Challenge{}) + Invokes(testing.NewUpdateActionWithOptions(challengesResource, c.ns, challenge, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Challenge), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeChallenges) UpdateStatus(ctx context.Context, challenge *v1.Challenge, opts metav1.UpdateOptions) (*v1.Challenge, error) { +func (c *FakeChallenges) UpdateStatus(ctx context.Context, challenge *v1.Challenge, opts metav1.UpdateOptions) (result *v1.Challenge, err error) { + emptyResult := &v1.Challenge{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(challengesResource, "status", c.ns, challenge), &v1.Challenge{}) + Invokes(testi
verify / Verify Deps and Codegen: pkg/client/certmanager/clientset/versioned/typed/acme/v1/fake/fake_order.go#L1
Please run ./hack/update-codegen.sh. diff --git a/pkg/client/certmanager/clientset/versioned/typed/acme/v1/fake/fake_order.go b/pkg/client/certmanager/clientset/versioned/typed/acme/v1/fake/fake_order.go index 2135c17..2ac148b 100644 --- a/pkg/client/certmanager/clientset/versioned/typed/acme/v1/fake/fake_order.go +++ b/pkg/client/certmanager/clientset/versioned/typed/acme/v1/fake/fake_order.go @@ -41,22 +41,24 @@ var ordersKind = v1.SchemeGroupVersion.WithKind("Order") // Get takes name of the order, and returns the corresponding order object, and an error if there is any. func (c *FakeOrders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Order, err error) { + emptyResult := &v1.Order{} obj, err := c.Fake. - Invokes(testing.NewGetAction(ordersResource, c.ns, name), &v1.Order{}) + Invokes(testing.NewGetActionWithOptions(ordersResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Order), err } // List takes label and field selectors, and returns the list of Orders that match those selectors. func (c *FakeOrders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.OrderList, err error) { + emptyResult := &v1.OrderList{} obj, err := c.Fake. - Invokes(testing.NewListAction(ordersResource, ordersKind, c.ns, opts), &v1.OrderList{}) + Invokes(testing.NewListActionWithOptions(ordersResource, ordersKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -75,40 +77,43 @@ func (c *FakeOrders) List(ctx context.Context, opts metav1.ListOptions) (result // Watch returns a watch.Interface that watches the requested orders. func (c *FakeOrders) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(ordersResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(ordersResource, c.ns, opts)) } // Create takes the representation of a order and creates it. Returns the server's representation of the order, and an error, if there is any. func (c *FakeOrders) Create(ctx context.Context, order *v1.Order, opts metav1.CreateOptions) (result *v1.Order, err error) { + emptyResult := &v1.Order{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(ordersResource, c.ns, order), &v1.Order{}) + Invokes(testing.NewCreateActionWithOptions(ordersResource, c.ns, order, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Order), err } // Update takes the representation of a order and updates it. Returns the server's representation of the order, and an error, if there is any. func (c *FakeOrders) Update(ctx context.Context, order *v1.Order, opts metav1.UpdateOptions) (result *v1.Order, err error) { + emptyResult := &v1.Order{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(ordersResource, c.ns, order), &v1.Order{}) + Invokes(testing.NewUpdateActionWithOptions(ordersResource, c.ns, order, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Order), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeOrders) UpdateStatus(ctx context.Context, order *v1.Order, opts metav1.UpdateOptions) (*v1.Order, error) { +func (c *FakeOrders) UpdateStatus(ctx context.Context, order *v1.Order, opts metav1.UpdateOptions) (result *v1.Order, err error) { + emptyResult := &v1.Order{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(ordersResource, "status", c.ns, order), &v1.Order{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(ordersResource, "status", c.ns, order, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Order), err } @@ -123,7 +128,7 @@ func (c *FakeOrders) Delete(ctx context.Co
verify / Verify Deps and Codegen: pkg/client/certmanager/clientset/versioned/typed/acme/v1/order.go#L1
Please run ./hack/update-codegen.sh. diff --git a/pkg/client/certmanager/clientset/versioned/typed/acme/v1/order.go b/pkg/client/certmanager/clientset/versioned/typed/acme/v1/order.go index fce94c2..6f1124b 100644 --- a/pkg/client/certmanager/clientset/versioned/typed/acme/v1/order.go +++ b/pkg/client/certmanager/clientset/versioned/typed/acme/v1/order.go @@ -20,13 +20,12 @@ package v1 import ( "context" - "time" v1 "github.com/cert-manager/cert-manager/pkg/apis/acme/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" scheme "knative.dev/eventing/pkg/client/certmanager/clientset/versioned/scheme" ) @@ -40,6 +39,7 @@ type OrdersGetter interface { type OrderInterface interface { Create(ctx context.Context, order *v1.Order, opts metav1.CreateOptions) (*v1.Order, error) Update(ctx context.Context, order *v1.Order, opts metav1.UpdateOptions) (*v1.Order, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, order *v1.Order, opts metav1.UpdateOptions) (*v1.Order, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -52,144 +52,18 @@ type OrderInterface interface { // orders implements OrderInterface type orders struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.Order, *v1.OrderList] } // newOrders returns a Orders func newOrders(c *AcmeV1Client, namespace string) *orders { return &orders{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.Order, *v1.OrderList]( + "orders", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.Order { return &v1.Order{} }, + func() *v1.OrderList { return &v1.OrderList{} }), } } - -// Get takes name of the order, and returns the corresponding order object, and an error if there is any. -func (c *orders) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Order, err error) { - result = &v1.Order{} - err = c.client.Get(). - Namespace(c.ns). - Resource("orders"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Orders that match those selectors. -func (c *orders) List(ctx context.Context, opts metav1.ListOptions) (result *v1.OrderList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.OrderList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("orders"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested orders. -func (c *orders) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("orders"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a order and creates it. Returns the server's representation of the order, and an error, if there is any. -func (c *orders) Create(ctx context.Context, order *v1.Order, opts metav1.CreateOptions) (result *v1.Order, err error) { - result = &v1.Order{} - err = c.client.Post(). - Namespace(c.ns). - Resource("orders"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(order). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a order and updates it. Returns the server's representation of the order, and an error, if there is any. -func (c *orders) Update(ctx contex
verify / Verify Deps and Codegen: pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/certificate.go#L1
Please run ./hack/update-codegen.sh. diff --git a/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/certificate.go b/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/certificate.go index 33456fe..bacfc51 100644 --- a/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/certificate.go +++ b/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/certificate.go @@ -20,13 +20,12 @@ package v1 import ( "context" - "time" v1 "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" scheme "knative.dev/eventing/pkg/client/certmanager/clientset/versioned/scheme" ) @@ -40,6 +39,7 @@ type CertificatesGetter interface { type CertificateInterface interface { Create(ctx context.Context, certificate *v1.Certificate, opts metav1.CreateOptions) (*v1.Certificate, error) Update(ctx context.Context, certificate *v1.Certificate, opts metav1.UpdateOptions) (*v1.Certificate, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, certificate *v1.Certificate, opts metav1.UpdateOptions) (*v1.Certificate, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -52,144 +52,18 @@ type CertificateInterface interface { // certificates implements CertificateInterface type certificates struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.Certificate, *v1.CertificateList] } // newCertificates returns a Certificates func newCertificates(c *CertmanagerV1Client, namespace string) *certificates { return &certificates{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.Certificate, *v1.CertificateList]( + "certificates", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.Certificate { return &v1.Certificate{} }, + func() *v1.CertificateList { return &v1.CertificateList{} }), } } - -// Get takes name of the certificate, and returns the corresponding certificate object, and an error if there is any. -func (c *certificates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Certificate, err error) { - result = &v1.Certificate{} - err = c.client.Get(). - Namespace(c.ns). - Resource("certificates"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Certificates that match those selectors. -func (c *certificates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.CertificateList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("certificates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested certificates. -func (c *certificates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("certificates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a certificate and creates it. Returns the server's representation of the certificate, and an error, if there is any. -func (c *certificates) Create(ctx context.Context, certificate *v1.Certificate, opts metav1.CreateOptions) (result *v1.Certificate, err error) { - result = &v1.Cer
verify / Verify Deps and Codegen: pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/certificaterequest.go#L1
Please run ./hack/update-codegen.sh. diff --git a/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/certificaterequest.go b/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/certificaterequest.go index 3bd45a8..32adb88 100644 --- a/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/certificaterequest.go +++ b/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/certificaterequest.go @@ -20,13 +20,12 @@ package v1 import ( "context" - "time" v1 "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" scheme "knative.dev/eventing/pkg/client/certmanager/clientset/versioned/scheme" ) @@ -40,6 +39,7 @@ type CertificateRequestsGetter interface { type CertificateRequestInterface interface { Create(ctx context.Context, certificateRequest *v1.CertificateRequest, opts metav1.CreateOptions) (*v1.CertificateRequest, error) Update(ctx context.Context, certificateRequest *v1.CertificateRequest, opts metav1.UpdateOptions) (*v1.CertificateRequest, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, certificateRequest *v1.CertificateRequest, opts metav1.UpdateOptions) (*v1.CertificateRequest, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -52,144 +52,18 @@ type CertificateRequestInterface interface { // certificateRequests implements CertificateRequestInterface type certificateRequests struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.CertificateRequest, *v1.CertificateRequestList] } // newCertificateRequests returns a CertificateRequests func newCertificateRequests(c *CertmanagerV1Client, namespace string) *certificateRequests { return &certificateRequests{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.CertificateRequest, *v1.CertificateRequestList]( + "certificaterequests", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.CertificateRequest { return &v1.CertificateRequest{} }, + func() *v1.CertificateRequestList { return &v1.CertificateRequestList{} }), } } - -// Get takes name of the certificateRequest, and returns the corresponding certificateRequest object, and an error if there is any. -func (c *certificateRequests) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CertificateRequest, err error) { - result = &v1.CertificateRequest{} - err = c.client.Get(). - Namespace(c.ns). - Resource("certificaterequests"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CertificateRequests that match those selectors. -func (c *certificateRequests) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateRequestList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.CertificateRequestList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("certificaterequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested certificateRequests. -func (c *certificateRequests) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("certificaterequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ct
verify / Verify Deps and Codegen: pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/clusterissuer.go#L1
Please run ./hack/update-codegen.sh. diff --git a/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/clusterissuer.go b/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/clusterissuer.go index 37de6f7..f01f95a 100644 --- a/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/clusterissuer.go +++ b/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/clusterissuer.go @@ -20,13 +20,12 @@ package v1 import ( "context" - "time" v1 "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" scheme "knative.dev/eventing/pkg/client/certmanager/clientset/versioned/scheme" ) @@ -40,6 +39,7 @@ type ClusterIssuersGetter interface { type ClusterIssuerInterface interface { Create(ctx context.Context, clusterIssuer *v1.ClusterIssuer, opts metav1.CreateOptions) (*v1.ClusterIssuer, error) Update(ctx context.Context, clusterIssuer *v1.ClusterIssuer, opts metav1.UpdateOptions) (*v1.ClusterIssuer, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, clusterIssuer *v1.ClusterIssuer, opts metav1.UpdateOptions) (*v1.ClusterIssuer, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -52,133 +52,18 @@ type ClusterIssuerInterface interface { // clusterIssuers implements ClusterIssuerInterface type clusterIssuers struct { - client rest.Interface + *gentype.ClientWithList[*v1.ClusterIssuer, *v1.ClusterIssuerList] } // newClusterIssuers returns a ClusterIssuers func newClusterIssuers(c *CertmanagerV1Client) *clusterIssuers { return &clusterIssuers{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.ClusterIssuer, *v1.ClusterIssuerList]( + "clusterissuers", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.ClusterIssuer { return &v1.ClusterIssuer{} }, + func() *v1.ClusterIssuerList { return &v1.ClusterIssuerList{} }), } } - -// Get takes name of the clusterIssuer, and returns the corresponding clusterIssuer object, and an error if there is any. -func (c *clusterIssuers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterIssuer, err error) { - result = &v1.ClusterIssuer{} - err = c.client.Get(). - Resource("clusterissuers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterIssuers that match those selectors. -func (c *clusterIssuers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterIssuerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ClusterIssuerList{} - err = c.client.Get(). - Resource("clusterissuers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterIssuers. -func (c *clusterIssuers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("clusterissuers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterIssuer and creates it. Returns the server's representation of the clusterIssuer, and an error, if there is any. -func (c *clusterIssuers) Create(ctx context.Context, clusterIssuer *v1.ClusterIssuer, opts metav1.CreateOptions) (result *v1.ClusterIssuer, err error) { - result = &v1.ClusterIssuer{} - er
verify / Verify Deps and Codegen: pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/fake/fake_certificate.go#L1
Please run ./hack/update-codegen.sh. diff --git a/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/fake/fake_certificate.go b/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/fake/fake_certificate.go index b87a96a..6d14437 100644 --- a/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/fake/fake_certificate.go +++ b/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/fake/fake_certificate.go @@ -41,22 +41,24 @@ var certificatesKind = v1.SchemeGroupVersion.WithKind("Certificate") // Get takes name of the certificate, and returns the corresponding certificate object, and an error if there is any. func (c *FakeCertificates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Certificate, err error) { + emptyResult := &v1.Certificate{} obj, err := c.Fake. - Invokes(testing.NewGetAction(certificatesResource, c.ns, name), &v1.Certificate{}) + Invokes(testing.NewGetActionWithOptions(certificatesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Certificate), err } // List takes label and field selectors, and returns the list of Certificates that match those selectors. func (c *FakeCertificates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateList, err error) { + emptyResult := &v1.CertificateList{} obj, err := c.Fake. - Invokes(testing.NewListAction(certificatesResource, certificatesKind, c.ns, opts), &v1.CertificateList{}) + Invokes(testing.NewListActionWithOptions(certificatesResource, certificatesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -75,40 +77,43 @@ func (c *FakeCertificates) List(ctx context.Context, opts metav1.ListOptions) (r // Watch returns a watch.Interface that watches the requested certificates. func (c *FakeCertificates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(certificatesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(certificatesResource, c.ns, opts)) } // Create takes the representation of a certificate and creates it. Returns the server's representation of the certificate, and an error, if there is any. func (c *FakeCertificates) Create(ctx context.Context, certificate *v1.Certificate, opts metav1.CreateOptions) (result *v1.Certificate, err error) { + emptyResult := &v1.Certificate{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(certificatesResource, c.ns, certificate), &v1.Certificate{}) + Invokes(testing.NewCreateActionWithOptions(certificatesResource, c.ns, certificate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Certificate), err } // Update takes the representation of a certificate and updates it. Returns the server's representation of the certificate, and an error, if there is any. func (c *FakeCertificates) Update(ctx context.Context, certificate *v1.Certificate, opts metav1.UpdateOptions) (result *v1.Certificate, err error) { + emptyResult := &v1.Certificate{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(certificatesResource, c.ns, certificate), &v1.Certificate{}) + Invokes(testing.NewUpdateActionWithOptions(certificatesResource, c.ns, certificate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Certificate), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeCertificates) UpdateStatus(ctx context.Context, certificate *v1.Certificate, opts metav1.UpdateOptions) (*v1.Certificate, error) { +func (c *FakeCertificates) UpdateStatus(ctx context.Context, certificate *v1.Certificate, opts metav1.UpdateOptions) (result *v1.Certificate, err error) { + emptyResult := &v1.Certifica
verify / Verify Deps and Codegen: pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/fake/fake_certificaterequest.go#L1
Please run ./hack/update-codegen.sh. diff --git a/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/fake/fake_certificaterequest.go b/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/fake/fake_certificaterequest.go index fd1cd2f..44c9a44 100644 --- a/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/fake/fake_certificaterequest.go +++ b/pkg/client/certmanager/clientset/versioned/typed/certmanager/v1/fake/fake_certificaterequest.go @@ -41,22 +41,24 @@ var certificaterequestsKind = v1.SchemeGroupVersion.WithKind("CertificateRequest // Get takes name of the certificateRequest, and returns the corresponding certificateRequest object, and an error if there is any. func (c *FakeCertificateRequests) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CertificateRequest, err error) { + emptyResult := &v1.CertificateRequest{} obj, err := c.Fake. - Invokes(testing.NewGetAction(certificaterequestsResource, c.ns, name), &v1.CertificateRequest{}) + Invokes(testing.NewGetActionWithOptions(certificaterequestsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CertificateRequest), err } // List takes label and field selectors, and returns the list of CertificateRequests that match those selectors. func (c *FakeCertificateRequests) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateRequestList, err error) { + emptyResult := &v1.CertificateRequestList{} obj, err := c.Fake. - Invokes(testing.NewListAction(certificaterequestsResource, certificaterequestsKind, c.ns, opts), &v1.CertificateRequestList{}) + Invokes(testing.NewListActionWithOptions(certificaterequestsResource, certificaterequestsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -75,40 +77,43 @@ func (c *FakeCertificateRequests) List(ctx context.Context, opts metav1.ListOpti // Watch returns a watch.Interface that watches the requested certificateRequests. func (c *FakeCertificateRequests) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(certificaterequestsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(certificaterequestsResource, c.ns, opts)) } // Create takes the representation of a certificateRequest and creates it. Returns the server's representation of the certificateRequest, and an error, if there is any. func (c *FakeCertificateRequests) Create(ctx context.Context, certificateRequest *v1.CertificateRequest, opts metav1.CreateOptions) (result *v1.CertificateRequest, err error) { + emptyResult := &v1.CertificateRequest{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(certificaterequestsResource, c.ns, certificateRequest), &v1.CertificateRequest{}) + Invokes(testing.NewCreateActionWithOptions(certificaterequestsResource, c.ns, certificateRequest, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CertificateRequest), err } // Update takes the representation of a certificateRequest and updates it. Returns the server's representation of the certificateRequest, and an error, if there is any. func (c *FakeCertificateRequests) Update(ctx context.Context, certificateRequest *v1.CertificateRequest, opts metav1.UpdateOptions) (result *v1.CertificateRequest, err error) { + emptyResult := &v1.CertificateRequest{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(certificaterequestsResource, c.ns, certificateRequest), &v1.CertificateRequest{}) + Invokes(testing.NewUpdateActionWithOptions(certificaterequestsResource, c.ns, certificateRequest, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CertificateRequest), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above
verify / Verify Deps and Codegen
Restore cache failed: Dependencies file is not found in /home/runner/work/eventing/eventing. Supported file pattern: go.sum