Skip to content

Commit d967104

Browse files
committed
update client gen
1 parent 8508875 commit d967104

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

staging/src/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ func (c *Fake$.type|publicPlural$) Get(ctx context.Context, $.type|private$Name
375375

376376
var deleteTemplate = `
377377
// Delete takes name of the $.type|private$ and deletes it. Returns an error if one occurs.
378-
func (c *Fake$.type|publicPlural$) Delete(ctx context.Context, name string, options *$.DeleteOptions|raw$) error {
378+
func (c *Fake$.type|publicPlural$) Delete(ctx context.Context, name string, opts $.DeleteOptions|raw$) error {
379379
_, err := c.Fake.
380380
$if .namespaced$Invokes($.NewDeleteAction|raw$($.type|allLowercasePlural$Resource, c.ns, name), &$.type|raw${})
381381
$else$Invokes($.NewRootDeleteAction|raw$($.type|allLowercasePlural$Resource, name), &$.type|raw${})$end$
@@ -385,9 +385,9 @@ func (c *Fake$.type|publicPlural$) Delete(ctx context.Context, name string, opti
385385

386386
var deleteCollectionTemplate = `
387387
// DeleteCollection deletes a collection of objects.
388-
func (c *Fake$.type|publicPlural$) DeleteCollection(ctx context.Context, options *$.DeleteOptions|raw$, listOptions $.ListOptions|raw$) error {
389-
$if .namespaced$action := $.NewDeleteCollectionAction|raw$($.type|allLowercasePlural$Resource, c.ns, listOptions)
390-
$else$action := $.NewRootDeleteCollectionAction|raw$($.type|allLowercasePlural$Resource, listOptions)
388+
func (c *Fake$.type|publicPlural$) DeleteCollection(ctx context.Context, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error {
389+
$if .namespaced$action := $.NewDeleteCollectionAction|raw$($.type|allLowercasePlural$Resource, c.ns, listOpts)
390+
$else$action := $.NewRootDeleteCollectionAction|raw$($.type|allLowercasePlural$Resource, listOpts)
391391
$end$
392392
_, err := c.Fake.Invokes(action, &$.type|raw$List{})
393393
return err

staging/src/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ var defaultVerbTemplates = map[string]string{
320320
"create": `Create(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (*$.resultType|raw$, error)`,
321321
"update": `Update(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (*$.resultType|raw$, error)`,
322322
"updateStatus": `UpdateStatus(ctx context.Context, $.inputType|private$ *$.type|raw$, opts $.UpdateOptions|raw$) (*$.type|raw$, error)`,
323-
"delete": `Delete(ctx context.Context, name string, opts *$.DeleteOptions|raw$) error`,
324-
"deleteCollection": `DeleteCollection(ctx context.Context, opts *$.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error`,
323+
"delete": `Delete(ctx context.Context, name string, opts $.DeleteOptions|raw$) error`,
324+
"deleteCollection": `DeleteCollection(ctx context.Context, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error`,
325325
"get": `Get(ctx context.Context, name string, opts $.GetOptions|raw$) (*$.resultType|raw$, error)`,
326326
"list": `List(ctx context.Context, opts $.ListOptions|raw$) (*$.resultType|raw$List, error)`,
327327
"watch": `Watch(ctx context.Context, opts $.ListOptions|raw$) ($.watchInterface|raw$, error)`,
@@ -463,30 +463,30 @@ func (c *$.type|privatePlural$) Get(ctx context.Context, $.type|private$Name str
463463

464464
var deleteTemplate = `
465465
// Delete takes name of the $.type|private$ and deletes it. Returns an error if one occurs.
466-
func (c *$.type|privatePlural$) Delete(ctx context.Context, name string, options *$.DeleteOptions|raw$) error {
466+
func (c *$.type|privatePlural$) Delete(ctx context.Context, name string, opts $.DeleteOptions|raw$) error {
467467
return c.client.Delete().
468468
$if .namespaced$Namespace(c.ns).$end$
469469
Resource("$.type|resource$").
470470
Name(name).
471-
Body(options).
471+
Body(&opts).
472472
Do(ctx).
473473
Error()
474474
}
475475
`
476476

477477
var deleteCollectionTemplate = `
478478
// DeleteCollection deletes a collection of objects.
479-
func (c *$.type|privatePlural$) DeleteCollection(ctx context.Context, options *$.DeleteOptions|raw$, listOptions $.ListOptions|raw$) error {
479+
func (c *$.type|privatePlural$) DeleteCollection(ctx context.Context, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error {
480480
var timeout time.Duration
481-
if listOptions.TimeoutSeconds != nil{
482-
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
481+
if listOpts.TimeoutSeconds != nil{
482+
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
483483
}
484484
return c.client.Delete().
485485
$if .namespaced$Namespace(c.ns).$end$
486486
Resource("$.type|resource$").
487-
VersionedParams(&listOptions, $.schemeParameterCodec|raw$).
487+
VersionedParams(&listOpts, $.schemeParameterCodec|raw$).
488488
Timeout(timeout).
489-
Body(options).
489+
Body(&opts).
490490
Do(ctx).
491491
Error()
492492
}

0 commit comments

Comments
 (0)