mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
Merge pull request #125915 from skitt/declare-funcs-client-gen
client-gen: use template function declarations for gentype
This commit is contained in:
commit
5c378996b1
@ -188,6 +188,10 @@ func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w i
|
|||||||
"ClientWithList": c.Universe.Type(types.Name{Package: "k8s.io/client-go/gentype", Name: "ClientWithList"}),
|
"ClientWithList": c.Universe.Type(types.Name{Package: "k8s.io/client-go/gentype", Name: "ClientWithList"}),
|
||||||
"ClientWithApply": c.Universe.Type(types.Name{Package: "k8s.io/client-go/gentype", Name: "ClientWithApply"}),
|
"ClientWithApply": c.Universe.Type(types.Name{Package: "k8s.io/client-go/gentype", Name: "ClientWithApply"}),
|
||||||
"ClientWithListAndApply": c.Universe.Type(types.Name{Package: "k8s.io/client-go/gentype", Name: "ClientWithListAndApply"}),
|
"ClientWithListAndApply": c.Universe.Type(types.Name{Package: "k8s.io/client-go/gentype", Name: "ClientWithListAndApply"}),
|
||||||
|
"NewClient": c.Universe.Function(types.Name{Package: "k8s.io/client-go/gentype", Name: "NewClient"}),
|
||||||
|
"NewClientWithApply": c.Universe.Function(types.Name{Package: "k8s.io/client-go/gentype", Name: "NewClientWithApply"}),
|
||||||
|
"NewClientWithList": c.Universe.Function(types.Name{Package: "k8s.io/client-go/gentype", Name: "NewClientWithList"}),
|
||||||
|
"NewClientWithListAndApply": c.Universe.Function(types.Name{Package: "k8s.io/client-go/gentype", Name: "NewClientWithListAndApply"}),
|
||||||
}
|
}
|
||||||
|
|
||||||
if generateApply {
|
if generateApply {
|
||||||
@ -474,7 +478,7 @@ var newStruct = []string{
|
|||||||
// new$.type|publicPlural$ returns a $.type|publicPlural$
|
// new$.type|publicPlural$ returns a $.type|publicPlural$
|
||||||
func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client, namespace string) *$.type|privatePlural$ {
|
func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client, namespace string) *$.type|privatePlural$ {
|
||||||
return &$.type|privatePlural${
|
return &$.type|privatePlural${
|
||||||
gentype.NewClient[*$.resultType|raw$](
|
$.NewClient|raw$[*$.resultType|raw$](
|
||||||
"$.type|resource$",
|
"$.type|resource$",
|
||||||
c.RESTClient(),
|
c.RESTClient(),
|
||||||
$.schemeParameterCodec|raw$,
|
$.schemeParameterCodec|raw$,
|
||||||
@ -487,7 +491,7 @@ var newStruct = []string{
|
|||||||
// new$.type|publicPlural$ returns a $.type|publicPlural$
|
// new$.type|publicPlural$ returns a $.type|publicPlural$
|
||||||
func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client, namespace string) *$.type|privatePlural$ {
|
func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client, namespace string) *$.type|privatePlural$ {
|
||||||
return &$.type|privatePlural${
|
return &$.type|privatePlural${
|
||||||
gentype.NewClientWithApply[*$.resultType|raw$, *$.inputApplyConfig|raw$](
|
$.NewClientWithApply|raw$[*$.resultType|raw$, *$.inputApplyConfig|raw$](
|
||||||
"$.type|resource$",
|
"$.type|resource$",
|
||||||
c.RESTClient(),
|
c.RESTClient(),
|
||||||
$.schemeParameterCodec|raw$,
|
$.schemeParameterCodec|raw$,
|
||||||
@ -500,7 +504,7 @@ var newStruct = []string{
|
|||||||
// new$.type|publicPlural$ returns a $.type|publicPlural$
|
// new$.type|publicPlural$ returns a $.type|publicPlural$
|
||||||
func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client, namespace string) *$.type|privatePlural$ {
|
func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client, namespace string) *$.type|privatePlural$ {
|
||||||
return &$.type|privatePlural${
|
return &$.type|privatePlural${
|
||||||
gentype.NewClientWithList[*$.resultType|raw$, *$.resultType|raw$List](
|
$.NewClientWithList|raw$[*$.resultType|raw$, *$.resultType|raw$List](
|
||||||
"$.type|resource$",
|
"$.type|resource$",
|
||||||
c.RESTClient(),
|
c.RESTClient(),
|
||||||
$.schemeParameterCodec|raw$,
|
$.schemeParameterCodec|raw$,
|
||||||
@ -514,7 +518,7 @@ var newStruct = []string{
|
|||||||
// new$.type|publicPlural$ returns a $.type|publicPlural$
|
// new$.type|publicPlural$ returns a $.type|publicPlural$
|
||||||
func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client, namespace string) *$.type|privatePlural$ {
|
func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client, namespace string) *$.type|privatePlural$ {
|
||||||
return &$.type|privatePlural${
|
return &$.type|privatePlural${
|
||||||
gentype.NewClientWithListAndApply[*$.resultType|raw$, *$.resultType|raw$List, *$.inputApplyConfig|raw$](
|
$.NewClientWithListAndApply|raw$[*$.resultType|raw$, *$.resultType|raw$List, *$.inputApplyConfig|raw$](
|
||||||
"$.type|resource$",
|
"$.type|resource$",
|
||||||
c.RESTClient(),
|
c.RESTClient(),
|
||||||
$.schemeParameterCodec|raw$,
|
$.schemeParameterCodec|raw$,
|
||||||
@ -528,7 +532,7 @@ var newStruct = []string{
|
|||||||
// new$.type|publicPlural$ returns a $.type|publicPlural$
|
// new$.type|publicPlural$ returns a $.type|publicPlural$
|
||||||
func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client) *$.type|privatePlural$ {
|
func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client) *$.type|privatePlural$ {
|
||||||
return &$.type|privatePlural${
|
return &$.type|privatePlural${
|
||||||
gentype.NewClient[*$.resultType|raw$](
|
$.NewClient|raw$[*$.resultType|raw$](
|
||||||
"$.type|resource$",
|
"$.type|resource$",
|
||||||
c.RESTClient(),
|
c.RESTClient(),
|
||||||
$.schemeParameterCodec|raw$,
|
$.schemeParameterCodec|raw$,
|
||||||
@ -541,7 +545,7 @@ var newStruct = []string{
|
|||||||
// new$.type|publicPlural$ returns a $.type|publicPlural$
|
// new$.type|publicPlural$ returns a $.type|publicPlural$
|
||||||
func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client) *$.type|privatePlural$ {
|
func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client) *$.type|privatePlural$ {
|
||||||
return &$.type|privatePlural${
|
return &$.type|privatePlural${
|
||||||
gentype.NewClientWithApply[*$.resultType|raw$, *$.inputApplyConfig|raw$](
|
$.NewClientWithApply|raw$[*$.resultType|raw$, *$.inputApplyConfig|raw$](
|
||||||
"$.type|resource$",
|
"$.type|resource$",
|
||||||
c.RESTClient(),
|
c.RESTClient(),
|
||||||
$.schemeParameterCodec|raw$,
|
$.schemeParameterCodec|raw$,
|
||||||
@ -554,7 +558,7 @@ var newStruct = []string{
|
|||||||
// new$.type|publicPlural$ returns a $.type|publicPlural$
|
// new$.type|publicPlural$ returns a $.type|publicPlural$
|
||||||
func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client) *$.type|privatePlural$ {
|
func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client) *$.type|privatePlural$ {
|
||||||
return &$.type|privatePlural${
|
return &$.type|privatePlural${
|
||||||
gentype.NewClientWithList[*$.resultType|raw$, *$.resultType|raw$List](
|
$.NewClientWithList|raw$[*$.resultType|raw$, *$.resultType|raw$List](
|
||||||
"$.type|resource$",
|
"$.type|resource$",
|
||||||
c.RESTClient(),
|
c.RESTClient(),
|
||||||
$.schemeParameterCodec|raw$,
|
$.schemeParameterCodec|raw$,
|
||||||
@ -568,7 +572,7 @@ var newStruct = []string{
|
|||||||
// new$.type|publicPlural$ returns a $.type|publicPlural$
|
// new$.type|publicPlural$ returns a $.type|publicPlural$
|
||||||
func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client) *$.type|privatePlural$ {
|
func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client) *$.type|privatePlural$ {
|
||||||
return &$.type|privatePlural${
|
return &$.type|privatePlural${
|
||||||
gentype.NewClientWithListAndApply[*$.resultType|raw$, *$.resultType|raw$List, *$.inputApplyConfig|raw$](
|
$.NewClientWithListAndApply|raw$[*$.resultType|raw$, *$.resultType|raw$List, *$.inputApplyConfig|raw$](
|
||||||
"$.type|resource$",
|
"$.type|resource$",
|
||||||
c.RESTClient(),
|
c.RESTClient(),
|
||||||
$.schemeParameterCodec|raw$,
|
$.schemeParameterCodec|raw$,
|
||||||
|
Loading…
Reference in New Issue
Block a user