From 13dfa4cbf542a2fcb444a0bd23cdae8347a9a753 Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Mon, 9 Sep 2024 16:55:53 +0200 Subject: [PATCH] Run codegen Signed-off-by: Stephen Kitt --- .../versioned/typed/extensions/v1/testtype.go | 10 ++++++---- staging/src/k8s.io/code-generator/examples/go.mod | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/staging/src/k8s.io/code-generator/examples/crd/clientset/versioned/typed/extensions/v1/testtype.go b/staging/src/k8s.io/code-generator/examples/crd/clientset/versioned/typed/extensions/v1/testtype.go index fb69c10cde2..8c51ce511cd 100644 --- a/staging/src/k8s.io/code-generator/examples/crd/clientset/versioned/typed/extensions/v1/testtype.go +++ b/staging/src/k8s.io/code-generator/examples/crd/clientset/versioned/typed/extensions/v1/testtype.go @@ -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). diff --git a/staging/src/k8s.io/code-generator/examples/go.mod b/staging/src/k8s.io/code-generator/examples/go.mod index 7494428e1f5..2495d201314 100644 --- a/staging/src/k8s.io/code-generator/examples/go.mod +++ b/staging/src/k8s.io/code-generator/examples/go.mod @@ -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