From 19857f1ed17dbf0ace611a38894b539bc5a2a79e Mon Sep 17 00:00:00 2001 From: Steve Kuznetsov Date: Thu, 26 Jan 2023 10:44:31 -0700 Subject: [PATCH] listergen: actually pass in a resource to the GroupResource constructor Signed-off-by: Steve Kuznetsov --- .../pkg/kcp/clients/listers/example/v1/clustertesttype.go | 4 ++-- examples/pkg/kcp/clients/listers/example/v1/testtype.go | 4 ++-- .../clients/listers/example/v1alpha1/clustertesttype.go | 4 ++-- .../pkg/kcp/clients/listers/example/v1alpha1/testtype.go | 4 ++-- .../clients/listers/example/v1beta1/clustertesttype.go | 4 ++-- .../pkg/kcp/clients/listers/example/v2/clustertesttype.go | 4 ++-- examples/pkg/kcp/clients/listers/example/v2/testtype.go | 4 ++-- .../kcp/clients/listers/example3/v1/clustertesttype.go | 4 ++-- examples/pkg/kcp/clients/listers/example3/v1/testtype.go | 4 ++-- .../listers/existinginterfaces/v1/clustertesttype.go | 4 ++-- .../kcp/clients/listers/existinginterfaces/v1/testtype.go | 4 ++-- .../clients/listers/secondexample/v1/clustertesttype.go | 4 ++-- .../pkg/kcp/clients/listers/secondexample/v1/testtype.go | 4 ++-- .../clients/listers/example/v1/clustertesttype.go | 2 +- .../kcpexisting/clients/listers/example/v1/testtype.go | 2 +- .../clients/listers/example/v1alpha1/clustertesttype.go | 2 +- .../clients/listers/example/v1alpha1/testtype.go | 2 +- .../clients/listers/example/v1beta1/clustertesttype.go | 2 +- .../clients/listers/example/v2/clustertesttype.go | 2 +- .../kcpexisting/clients/listers/example/v2/testtype.go | 2 +- .../clients/listers/example3/v1/clustertesttype.go | 2 +- .../kcpexisting/clients/listers/example3/v1/testtype.go | 2 +- .../listers/existinginterfaces/v1/clustertesttype.go | 2 +- .../clients/listers/existinginterfaces/v1/testtype.go | 2 +- .../clients/listers/secondexample/v1/clustertesttype.go | 2 +- .../clients/listers/secondexample/v1/testtype.go | 2 +- pkg/internal/listergen/lister.go | 8 ++++---- 27 files changed, 43 insertions(+), 43 deletions(-) diff --git a/examples/pkg/kcp/clients/listers/example/v1/clustertesttype.go b/examples/pkg/kcp/clients/listers/example/v1/clustertesttype.go index d6389b18c..9a8e7c172 100644 --- a/examples/pkg/kcp/clients/listers/example/v1/clustertesttype.go +++ b/examples/pkg/kcp/clients/listers/example/v1/clustertesttype.go @@ -103,7 +103,7 @@ func (s *clusterTestTypeLister) Get(name string) (*examplev1.ClusterTestType, er return nil, err } if !exists { - return nil, errors.NewNotFound(examplev1.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(examplev1.Resource("clustertesttypes"), name) } return obj.(*examplev1.ClusterTestType), nil } @@ -137,7 +137,7 @@ func (s *clusterTestTypeScopedLister) Get(name string) (*examplev1.ClusterTestTy return nil, err } if !exists { - return nil, errors.NewNotFound(examplev1.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(examplev1.Resource("clustertesttypes"), name) } return obj.(*examplev1.ClusterTestType), nil } diff --git a/examples/pkg/kcp/clients/listers/example/v1/testtype.go b/examples/pkg/kcp/clients/listers/example/v1/testtype.go index 6d48699cb..54df3a921 100644 --- a/examples/pkg/kcp/clients/listers/example/v1/testtype.go +++ b/examples/pkg/kcp/clients/listers/example/v1/testtype.go @@ -136,7 +136,7 @@ func (s *testTypeNamespaceLister) Get(name string) (*examplev1.TestType, error) return nil, err } if !exists { - return nil, errors.NewNotFound(examplev1.Resource("TestType"), name) + return nil, errors.NewNotFound(examplev1.Resource("testtypes"), name) } return obj.(*examplev1.TestType), nil } @@ -190,7 +190,7 @@ func (s *testTypeScopedNamespaceLister) Get(name string) (*examplev1.TestType, e return nil, err } if !exists { - return nil, errors.NewNotFound(examplev1.Resource("TestType"), name) + return nil, errors.NewNotFound(examplev1.Resource("testtypes"), name) } return obj.(*examplev1.TestType), nil } diff --git a/examples/pkg/kcp/clients/listers/example/v1alpha1/clustertesttype.go b/examples/pkg/kcp/clients/listers/example/v1alpha1/clustertesttype.go index 1c33c3500..96dd19f54 100644 --- a/examples/pkg/kcp/clients/listers/example/v1alpha1/clustertesttype.go +++ b/examples/pkg/kcp/clients/listers/example/v1alpha1/clustertesttype.go @@ -103,7 +103,7 @@ func (s *clusterTestTypeLister) Get(name string) (*examplev1alpha1.ClusterTestTy return nil, err } if !exists { - return nil, errors.NewNotFound(examplev1alpha1.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(examplev1alpha1.Resource("clustertesttypes"), name) } return obj.(*examplev1alpha1.ClusterTestType), nil } @@ -137,7 +137,7 @@ func (s *clusterTestTypeScopedLister) Get(name string) (*examplev1alpha1.Cluster return nil, err } if !exists { - return nil, errors.NewNotFound(examplev1alpha1.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(examplev1alpha1.Resource("clustertesttypes"), name) } return obj.(*examplev1alpha1.ClusterTestType), nil } diff --git a/examples/pkg/kcp/clients/listers/example/v1alpha1/testtype.go b/examples/pkg/kcp/clients/listers/example/v1alpha1/testtype.go index cfef219cc..092a8d581 100644 --- a/examples/pkg/kcp/clients/listers/example/v1alpha1/testtype.go +++ b/examples/pkg/kcp/clients/listers/example/v1alpha1/testtype.go @@ -136,7 +136,7 @@ func (s *testTypeNamespaceLister) Get(name string) (*examplev1alpha1.TestType, e return nil, err } if !exists { - return nil, errors.NewNotFound(examplev1alpha1.Resource("TestType"), name) + return nil, errors.NewNotFound(examplev1alpha1.Resource("testtypes"), name) } return obj.(*examplev1alpha1.TestType), nil } @@ -190,7 +190,7 @@ func (s *testTypeScopedNamespaceLister) Get(name string) (*examplev1alpha1.TestT return nil, err } if !exists { - return nil, errors.NewNotFound(examplev1alpha1.Resource("TestType"), name) + return nil, errors.NewNotFound(examplev1alpha1.Resource("testtypes"), name) } return obj.(*examplev1alpha1.TestType), nil } diff --git a/examples/pkg/kcp/clients/listers/example/v1beta1/clustertesttype.go b/examples/pkg/kcp/clients/listers/example/v1beta1/clustertesttype.go index 411d5d0bd..b67b7f9ee 100644 --- a/examples/pkg/kcp/clients/listers/example/v1beta1/clustertesttype.go +++ b/examples/pkg/kcp/clients/listers/example/v1beta1/clustertesttype.go @@ -103,7 +103,7 @@ func (s *clusterTestTypeLister) Get(name string) (*examplev1beta1.ClusterTestTyp return nil, err } if !exists { - return nil, errors.NewNotFound(examplev1beta1.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(examplev1beta1.Resource("clustertesttypes"), name) } return obj.(*examplev1beta1.ClusterTestType), nil } @@ -137,7 +137,7 @@ func (s *clusterTestTypeScopedLister) Get(name string) (*examplev1beta1.ClusterT return nil, err } if !exists { - return nil, errors.NewNotFound(examplev1beta1.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(examplev1beta1.Resource("clustertesttypes"), name) } return obj.(*examplev1beta1.ClusterTestType), nil } diff --git a/examples/pkg/kcp/clients/listers/example/v2/clustertesttype.go b/examples/pkg/kcp/clients/listers/example/v2/clustertesttype.go index d15a0e6e8..157fbe856 100644 --- a/examples/pkg/kcp/clients/listers/example/v2/clustertesttype.go +++ b/examples/pkg/kcp/clients/listers/example/v2/clustertesttype.go @@ -103,7 +103,7 @@ func (s *clusterTestTypeLister) Get(name string) (*examplev2.ClusterTestType, er return nil, err } if !exists { - return nil, errors.NewNotFound(examplev2.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(examplev2.Resource("clustertesttypes"), name) } return obj.(*examplev2.ClusterTestType), nil } @@ -137,7 +137,7 @@ func (s *clusterTestTypeScopedLister) Get(name string) (*examplev2.ClusterTestTy return nil, err } if !exists { - return nil, errors.NewNotFound(examplev2.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(examplev2.Resource("clustertesttypes"), name) } return obj.(*examplev2.ClusterTestType), nil } diff --git a/examples/pkg/kcp/clients/listers/example/v2/testtype.go b/examples/pkg/kcp/clients/listers/example/v2/testtype.go index ddcaaa15f..069ad8082 100644 --- a/examples/pkg/kcp/clients/listers/example/v2/testtype.go +++ b/examples/pkg/kcp/clients/listers/example/v2/testtype.go @@ -136,7 +136,7 @@ func (s *testTypeNamespaceLister) Get(name string) (*examplev2.TestType, error) return nil, err } if !exists { - return nil, errors.NewNotFound(examplev2.Resource("TestType"), name) + return nil, errors.NewNotFound(examplev2.Resource("testtypes"), name) } return obj.(*examplev2.TestType), nil } @@ -190,7 +190,7 @@ func (s *testTypeScopedNamespaceLister) Get(name string) (*examplev2.TestType, e return nil, err } if !exists { - return nil, errors.NewNotFound(examplev2.Resource("TestType"), name) + return nil, errors.NewNotFound(examplev2.Resource("testtypes"), name) } return obj.(*examplev2.TestType), nil } diff --git a/examples/pkg/kcp/clients/listers/example3/v1/clustertesttype.go b/examples/pkg/kcp/clients/listers/example3/v1/clustertesttype.go index ea2463f22..dd32331b4 100644 --- a/examples/pkg/kcp/clients/listers/example3/v1/clustertesttype.go +++ b/examples/pkg/kcp/clients/listers/example3/v1/clustertesttype.go @@ -103,7 +103,7 @@ func (s *clusterTestTypeLister) Get(name string) (*example3v1.ClusterTestType, e return nil, err } if !exists { - return nil, errors.NewNotFound(example3v1.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(example3v1.Resource("clustertesttypes"), name) } return obj.(*example3v1.ClusterTestType), nil } @@ -137,7 +137,7 @@ func (s *clusterTestTypeScopedLister) Get(name string) (*example3v1.ClusterTestT return nil, err } if !exists { - return nil, errors.NewNotFound(example3v1.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(example3v1.Resource("clustertesttypes"), name) } return obj.(*example3v1.ClusterTestType), nil } diff --git a/examples/pkg/kcp/clients/listers/example3/v1/testtype.go b/examples/pkg/kcp/clients/listers/example3/v1/testtype.go index 832c19112..c21ef2849 100644 --- a/examples/pkg/kcp/clients/listers/example3/v1/testtype.go +++ b/examples/pkg/kcp/clients/listers/example3/v1/testtype.go @@ -136,7 +136,7 @@ func (s *testTypeNamespaceLister) Get(name string) (*example3v1.TestType, error) return nil, err } if !exists { - return nil, errors.NewNotFound(example3v1.Resource("TestType"), name) + return nil, errors.NewNotFound(example3v1.Resource("testtypes"), name) } return obj.(*example3v1.TestType), nil } @@ -190,7 +190,7 @@ func (s *testTypeScopedNamespaceLister) Get(name string) (*example3v1.TestType, return nil, err } if !exists { - return nil, errors.NewNotFound(example3v1.Resource("TestType"), name) + return nil, errors.NewNotFound(example3v1.Resource("testtypes"), name) } return obj.(*example3v1.TestType), nil } diff --git a/examples/pkg/kcp/clients/listers/existinginterfaces/v1/clustertesttype.go b/examples/pkg/kcp/clients/listers/existinginterfaces/v1/clustertesttype.go index 25ce29856..86084abc8 100644 --- a/examples/pkg/kcp/clients/listers/existinginterfaces/v1/clustertesttype.go +++ b/examples/pkg/kcp/clients/listers/existinginterfaces/v1/clustertesttype.go @@ -103,7 +103,7 @@ func (s *clusterTestTypeLister) Get(name string) (*existinginterfacesv1.ClusterT return nil, err } if !exists { - return nil, errors.NewNotFound(existinginterfacesv1.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(existinginterfacesv1.Resource("clustertesttypes"), name) } return obj.(*existinginterfacesv1.ClusterTestType), nil } @@ -137,7 +137,7 @@ func (s *clusterTestTypeScopedLister) Get(name string) (*existinginterfacesv1.Cl return nil, err } if !exists { - return nil, errors.NewNotFound(existinginterfacesv1.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(existinginterfacesv1.Resource("clustertesttypes"), name) } return obj.(*existinginterfacesv1.ClusterTestType), nil } diff --git a/examples/pkg/kcp/clients/listers/existinginterfaces/v1/testtype.go b/examples/pkg/kcp/clients/listers/existinginterfaces/v1/testtype.go index e1962a865..06787be9e 100644 --- a/examples/pkg/kcp/clients/listers/existinginterfaces/v1/testtype.go +++ b/examples/pkg/kcp/clients/listers/existinginterfaces/v1/testtype.go @@ -136,7 +136,7 @@ func (s *testTypeNamespaceLister) Get(name string) (*existinginterfacesv1.TestTy return nil, err } if !exists { - return nil, errors.NewNotFound(existinginterfacesv1.Resource("TestType"), name) + return nil, errors.NewNotFound(existinginterfacesv1.Resource("testtypes"), name) } return obj.(*existinginterfacesv1.TestType), nil } @@ -190,7 +190,7 @@ func (s *testTypeScopedNamespaceLister) Get(name string) (*existinginterfacesv1. return nil, err } if !exists { - return nil, errors.NewNotFound(existinginterfacesv1.Resource("TestType"), name) + return nil, errors.NewNotFound(existinginterfacesv1.Resource("testtypes"), name) } return obj.(*existinginterfacesv1.TestType), nil } diff --git a/examples/pkg/kcp/clients/listers/secondexample/v1/clustertesttype.go b/examples/pkg/kcp/clients/listers/secondexample/v1/clustertesttype.go index 1ee28265e..98552b722 100644 --- a/examples/pkg/kcp/clients/listers/secondexample/v1/clustertesttype.go +++ b/examples/pkg/kcp/clients/listers/secondexample/v1/clustertesttype.go @@ -103,7 +103,7 @@ func (s *clusterTestTypeLister) Get(name string) (*secondexamplev1.ClusterTestTy return nil, err } if !exists { - return nil, errors.NewNotFound(secondexamplev1.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(secondexamplev1.Resource("clustertesttypes"), name) } return obj.(*secondexamplev1.ClusterTestType), nil } @@ -137,7 +137,7 @@ func (s *clusterTestTypeScopedLister) Get(name string) (*secondexamplev1.Cluster return nil, err } if !exists { - return nil, errors.NewNotFound(secondexamplev1.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(secondexamplev1.Resource("clustertesttypes"), name) } return obj.(*secondexamplev1.ClusterTestType), nil } diff --git a/examples/pkg/kcp/clients/listers/secondexample/v1/testtype.go b/examples/pkg/kcp/clients/listers/secondexample/v1/testtype.go index 61067c3d0..96f29577d 100644 --- a/examples/pkg/kcp/clients/listers/secondexample/v1/testtype.go +++ b/examples/pkg/kcp/clients/listers/secondexample/v1/testtype.go @@ -136,7 +136,7 @@ func (s *testTypeNamespaceLister) Get(name string) (*secondexamplev1.TestType, e return nil, err } if !exists { - return nil, errors.NewNotFound(secondexamplev1.Resource("TestType"), name) + return nil, errors.NewNotFound(secondexamplev1.Resource("testtypes"), name) } return obj.(*secondexamplev1.TestType), nil } @@ -190,7 +190,7 @@ func (s *testTypeScopedNamespaceLister) Get(name string) (*secondexamplev1.TestT return nil, err } if !exists { - return nil, errors.NewNotFound(secondexamplev1.Resource("TestType"), name) + return nil, errors.NewNotFound(secondexamplev1.Resource("testtypes"), name) } return obj.(*secondexamplev1.TestType), nil } diff --git a/examples/pkg/kcpexisting/clients/listers/example/v1/clustertesttype.go b/examples/pkg/kcpexisting/clients/listers/example/v1/clustertesttype.go index 950ccbfe0..c289b01a1 100644 --- a/examples/pkg/kcpexisting/clients/listers/example/v1/clustertesttype.go +++ b/examples/pkg/kcpexisting/clients/listers/example/v1/clustertesttype.go @@ -92,7 +92,7 @@ func (s *clusterTestTypeLister) Get(name string) (*examplev1.ClusterTestType, er return nil, err } if !exists { - return nil, errors.NewNotFound(examplev1.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(examplev1.Resource("clustertesttypes"), name) } return obj.(*examplev1.ClusterTestType), nil } diff --git a/examples/pkg/kcpexisting/clients/listers/example/v1/testtype.go b/examples/pkg/kcpexisting/clients/listers/example/v1/testtype.go index e6fb58c55..028a87771 100644 --- a/examples/pkg/kcpexisting/clients/listers/example/v1/testtype.go +++ b/examples/pkg/kcpexisting/clients/listers/example/v1/testtype.go @@ -113,7 +113,7 @@ func (s *testTypeNamespaceLister) Get(name string) (*examplev1.TestType, error) return nil, err } if !exists { - return nil, errors.NewNotFound(examplev1.Resource("TestType"), name) + return nil, errors.NewNotFound(examplev1.Resource("testtypes"), name) } return obj.(*examplev1.TestType), nil } diff --git a/examples/pkg/kcpexisting/clients/listers/example/v1alpha1/clustertesttype.go b/examples/pkg/kcpexisting/clients/listers/example/v1alpha1/clustertesttype.go index bd5abea47..44ab6bff9 100644 --- a/examples/pkg/kcpexisting/clients/listers/example/v1alpha1/clustertesttype.go +++ b/examples/pkg/kcpexisting/clients/listers/example/v1alpha1/clustertesttype.go @@ -92,7 +92,7 @@ func (s *clusterTestTypeLister) Get(name string) (*examplev1alpha1.ClusterTestTy return nil, err } if !exists { - return nil, errors.NewNotFound(examplev1alpha1.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(examplev1alpha1.Resource("clustertesttypes"), name) } return obj.(*examplev1alpha1.ClusterTestType), nil } diff --git a/examples/pkg/kcpexisting/clients/listers/example/v1alpha1/testtype.go b/examples/pkg/kcpexisting/clients/listers/example/v1alpha1/testtype.go index 516f80301..74468b758 100644 --- a/examples/pkg/kcpexisting/clients/listers/example/v1alpha1/testtype.go +++ b/examples/pkg/kcpexisting/clients/listers/example/v1alpha1/testtype.go @@ -113,7 +113,7 @@ func (s *testTypeNamespaceLister) Get(name string) (*examplev1alpha1.TestType, e return nil, err } if !exists { - return nil, errors.NewNotFound(examplev1alpha1.Resource("TestType"), name) + return nil, errors.NewNotFound(examplev1alpha1.Resource("testtypes"), name) } return obj.(*examplev1alpha1.TestType), nil } diff --git a/examples/pkg/kcpexisting/clients/listers/example/v1beta1/clustertesttype.go b/examples/pkg/kcpexisting/clients/listers/example/v1beta1/clustertesttype.go index ec6a8caf7..f28f04c76 100644 --- a/examples/pkg/kcpexisting/clients/listers/example/v1beta1/clustertesttype.go +++ b/examples/pkg/kcpexisting/clients/listers/example/v1beta1/clustertesttype.go @@ -92,7 +92,7 @@ func (s *clusterTestTypeLister) Get(name string) (*examplev1beta1.ClusterTestTyp return nil, err } if !exists { - return nil, errors.NewNotFound(examplev1beta1.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(examplev1beta1.Resource("clustertesttypes"), name) } return obj.(*examplev1beta1.ClusterTestType), nil } diff --git a/examples/pkg/kcpexisting/clients/listers/example/v2/clustertesttype.go b/examples/pkg/kcpexisting/clients/listers/example/v2/clustertesttype.go index 0d83252bc..d587dcc46 100644 --- a/examples/pkg/kcpexisting/clients/listers/example/v2/clustertesttype.go +++ b/examples/pkg/kcpexisting/clients/listers/example/v2/clustertesttype.go @@ -92,7 +92,7 @@ func (s *clusterTestTypeLister) Get(name string) (*examplev2.ClusterTestType, er return nil, err } if !exists { - return nil, errors.NewNotFound(examplev2.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(examplev2.Resource("clustertesttypes"), name) } return obj.(*examplev2.ClusterTestType), nil } diff --git a/examples/pkg/kcpexisting/clients/listers/example/v2/testtype.go b/examples/pkg/kcpexisting/clients/listers/example/v2/testtype.go index 01b1823b3..b94a32c92 100644 --- a/examples/pkg/kcpexisting/clients/listers/example/v2/testtype.go +++ b/examples/pkg/kcpexisting/clients/listers/example/v2/testtype.go @@ -113,7 +113,7 @@ func (s *testTypeNamespaceLister) Get(name string) (*examplev2.TestType, error) return nil, err } if !exists { - return nil, errors.NewNotFound(examplev2.Resource("TestType"), name) + return nil, errors.NewNotFound(examplev2.Resource("testtypes"), name) } return obj.(*examplev2.TestType), nil } diff --git a/examples/pkg/kcpexisting/clients/listers/example3/v1/clustertesttype.go b/examples/pkg/kcpexisting/clients/listers/example3/v1/clustertesttype.go index 135d20917..13b06d11e 100644 --- a/examples/pkg/kcpexisting/clients/listers/example3/v1/clustertesttype.go +++ b/examples/pkg/kcpexisting/clients/listers/example3/v1/clustertesttype.go @@ -92,7 +92,7 @@ func (s *clusterTestTypeLister) Get(name string) (*example3v1.ClusterTestType, e return nil, err } if !exists { - return nil, errors.NewNotFound(example3v1.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(example3v1.Resource("clustertesttypes"), name) } return obj.(*example3v1.ClusterTestType), nil } diff --git a/examples/pkg/kcpexisting/clients/listers/example3/v1/testtype.go b/examples/pkg/kcpexisting/clients/listers/example3/v1/testtype.go index a1ed50b67..e7dd12058 100644 --- a/examples/pkg/kcpexisting/clients/listers/example3/v1/testtype.go +++ b/examples/pkg/kcpexisting/clients/listers/example3/v1/testtype.go @@ -113,7 +113,7 @@ func (s *testTypeNamespaceLister) Get(name string) (*example3v1.TestType, error) return nil, err } if !exists { - return nil, errors.NewNotFound(example3v1.Resource("TestType"), name) + return nil, errors.NewNotFound(example3v1.Resource("testtypes"), name) } return obj.(*example3v1.TestType), nil } diff --git a/examples/pkg/kcpexisting/clients/listers/existinginterfaces/v1/clustertesttype.go b/examples/pkg/kcpexisting/clients/listers/existinginterfaces/v1/clustertesttype.go index 01c4e7701..01298dafb 100644 --- a/examples/pkg/kcpexisting/clients/listers/existinginterfaces/v1/clustertesttype.go +++ b/examples/pkg/kcpexisting/clients/listers/existinginterfaces/v1/clustertesttype.go @@ -92,7 +92,7 @@ func (s *clusterTestTypeLister) Get(name string) (*existinginterfacesv1.ClusterT return nil, err } if !exists { - return nil, errors.NewNotFound(existinginterfacesv1.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(existinginterfacesv1.Resource("clustertesttypes"), name) } return obj.(*existinginterfacesv1.ClusterTestType), nil } diff --git a/examples/pkg/kcpexisting/clients/listers/existinginterfaces/v1/testtype.go b/examples/pkg/kcpexisting/clients/listers/existinginterfaces/v1/testtype.go index 592608450..12b3eeb50 100644 --- a/examples/pkg/kcpexisting/clients/listers/existinginterfaces/v1/testtype.go +++ b/examples/pkg/kcpexisting/clients/listers/existinginterfaces/v1/testtype.go @@ -113,7 +113,7 @@ func (s *testTypeNamespaceLister) Get(name string) (*existinginterfacesv1.TestTy return nil, err } if !exists { - return nil, errors.NewNotFound(existinginterfacesv1.Resource("TestType"), name) + return nil, errors.NewNotFound(existinginterfacesv1.Resource("testtypes"), name) } return obj.(*existinginterfacesv1.TestType), nil } diff --git a/examples/pkg/kcpexisting/clients/listers/secondexample/v1/clustertesttype.go b/examples/pkg/kcpexisting/clients/listers/secondexample/v1/clustertesttype.go index 839d97076..107514938 100644 --- a/examples/pkg/kcpexisting/clients/listers/secondexample/v1/clustertesttype.go +++ b/examples/pkg/kcpexisting/clients/listers/secondexample/v1/clustertesttype.go @@ -92,7 +92,7 @@ func (s *clusterTestTypeLister) Get(name string) (*secondexamplev1.ClusterTestTy return nil, err } if !exists { - return nil, errors.NewNotFound(secondexamplev1.Resource("ClusterTestType"), name) + return nil, errors.NewNotFound(secondexamplev1.Resource("clustertesttypes"), name) } return obj.(*secondexamplev1.ClusterTestType), nil } diff --git a/examples/pkg/kcpexisting/clients/listers/secondexample/v1/testtype.go b/examples/pkg/kcpexisting/clients/listers/secondexample/v1/testtype.go index 84c964a09..699c26089 100644 --- a/examples/pkg/kcpexisting/clients/listers/secondexample/v1/testtype.go +++ b/examples/pkg/kcpexisting/clients/listers/secondexample/v1/testtype.go @@ -113,7 +113,7 @@ func (s *testTypeNamespaceLister) Get(name string) (*secondexamplev1.TestType, e return nil, err } if !exists { - return nil, errors.NewNotFound(secondexamplev1.Resource("TestType"), name) + return nil, errors.NewNotFound(secondexamplev1.Resource("testtypes"), name) } return obj.(*secondexamplev1.TestType), nil } diff --git a/pkg/internal/listergen/lister.go b/pkg/internal/listergen/lister.go index a4d80841c..48ff2416c 100644 --- a/pkg/internal/listergen/lister.go +++ b/pkg/internal/listergen/lister.go @@ -162,7 +162,7 @@ func (s *{{.kind.String | lowerFirst}}Lister) Get(name string) (*{{.group.Packag return nil, err } if !exists { - return nil, errors.NewNotFound({{.group.PackageAlias}}.Resource("{{.kind.String}}"), name) + return nil, errors.NewNotFound({{.group.PackageAlias}}.Resource("{{.kind.Plural | toLower}}"), name) } return obj.(*{{.group.PackageAlias}}.{{.kind.String}}), nil } @@ -219,7 +219,7 @@ func (s *{{.kind.String | lowerFirst}}NamespaceLister) Get(name string) (*{{.gro return nil, err } if !exists { - return nil, errors.NewNotFound({{.group.PackageAlias}}.Resource("{{.kind.String}}"), name) + return nil, errors.NewNotFound({{.group.PackageAlias}}.Resource("{{.kind.Plural | toLower}}"), name) } return obj.(*{{.group.PackageAlias}}.{{.kind.String}}), nil } @@ -259,7 +259,7 @@ func (s *{{.kind.String | lowerFirst}}ScopedLister) Get(name string) (*{{.group. return nil, err } if !exists { - return nil, errors.NewNotFound({{.group.PackageAlias}}.Resource("{{.kind.String}}"), name) + return nil, errors.NewNotFound({{.group.PackageAlias}}.Resource("{{.kind.Plural | toLower}}"), name) } return obj.(*{{.group.PackageAlias}}.{{.kind.String}}), nil } @@ -291,7 +291,7 @@ func (s *{{.kind.String | lowerFirst}}ScopedNamespaceLister) Get(name string) (* return nil, err } if !exists { - return nil, errors.NewNotFound({{.group.PackageAlias}}.Resource("{{.kind.String}}"), name) + return nil, errors.NewNotFound({{.group.PackageAlias}}.Resource("{{.kind.Plural | toLower}}"), name) } return obj.(*{{.group.PackageAlias}}.{{.kind.String}}), nil }