Run codegen

Signed-off-by: Stephen Kitt <skitt@redhat.com>
This commit is contained in:
Stephen Kitt 2024-09-09 16:55:53 +02:00
parent 7313fec892
commit 13dfa4cbf5
No known key found for this signature in database
GPG Key ID: 1CC5FA453662A71D
2 changed files with 7 additions and 5 deletions

View File

@ -22,6 +22,7 @@ import (
context "context"
json "encoding/json"
fmt "fmt"
time "time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
@ -32,6 +33,7 @@ import (
extensionsv1 "k8s.io/code-generator/examples/crd/apis/extensions/v1"
applyconfigurationextensionsv1 "k8s.io/code-generator/examples/crd/applyconfiguration/extensions/v1"
scheme "k8s.io/code-generator/examples/crd/clientset/versioned/scheme"
v2 "k8s.io/klog/v2"
)
// TestTypesGetter has a method to return a TestTypeInterface.
@ -103,14 +105,14 @@ func (c *testTypes) GetExtended(ctx context.Context, name string, options metav1
// ListExtended takes label and field selectors, and returns the list of TestTypes that match those selectors.
func (c *testTypes) ListExtended(ctx context.Context, opts metav1.ListOptions) (*extensionsv1.TestTypeList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for testtypes, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
v2.Warningf("Failed preparing watchlist options for testtypes, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for testtypes", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for testtypes ended with an error, falling back to the standard LIST semantics, err = %v", err)
v2.Warningf("The watchlist request for testtypes ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
@ -143,8 +145,8 @@ func (c *testTypes) watchList(ctx context.Context, opts metav1.ListOptions) (res
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &extensionsv1.TestTypeList{}
err = c.client.Get().
Namespace(c.ns).
err = c.GetClient().Get().
Namespace(c.GetNamespace()).
Resource("testtypes").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).

View File

@ -10,6 +10,7 @@ require (
k8s.io/api v0.0.0
k8s.io/apimachinery v0.0.0
k8s.io/client-go v0.0.0
k8s.io/klog/v2 v2.130.1
k8s.io/kube-openapi v0.0.0-20240827152857-f7e401e7b4c2
sigs.k8s.io/structured-merge-diff/v4 v4.4.1
)
@ -47,7 +48,6 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/yaml v1.4.0 // indirect