Skip to content

Commit

Permalink
Use SubResource method to implement Status method
Browse files Browse the repository at this point in the history
  • Loading branch information
g7r authored and jmcshane committed Oct 3, 2022
1 parent 5112355 commit 55b27c9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/client/client.go
Expand Up @@ -289,7 +289,7 @@ func (c *client) List(ctx context.Context, obj ObjectList, opts ...ListOption) e

// Status implements client.StatusClient.
func (c *client) Status() SubResourceWriter {
return &subResourceWriter{client: c, subResource: "status"}
return c.SubResource("status")
}

func (c *client) SubResource(subResource string) SubResourceWriter {
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/dryrun.go
Expand Up @@ -83,7 +83,7 @@ func (c *dryRunClient) List(ctx context.Context, obj ObjectList, opts ...ListOpt

// Status implements client.StatusClient.
func (c *dryRunClient) Status() SubResourceWriter {
return &dryRunSubResourceWriter{client: c.client.SubResource("status")}
return c.SubResource("status")
}

// SubResource implements client.SubResourceClient.
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/fake/client.go
Expand Up @@ -635,7 +635,7 @@ func (c *fakeClient) Patch(ctx context.Context, obj client.Object, patch client.
}

func (c *fakeClient) Status() client.SubResourceWriter {
return &fakeSubResourceWriter{client: c}
return c.SubResource("status")
}

func (c *fakeClient) SubResource(subResource string) client.SubResourceWriter {
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/namespaced_client.go
Expand Up @@ -162,7 +162,7 @@ func (n *namespacedClient) List(ctx context.Context, obj ObjectList, opts ...Lis

// Status implements client.StatusClient.
func (n *namespacedClient) Status() SubResourceWriter {
return &namespacedClientSubResourceWriter{StatusClient: n.client.SubResource("status"), namespace: n.namespace, namespacedclient: n}
return n.SubResource("status")
}

// SubResource implements client.SubResourceClient.
Expand Down

0 comments on commit 55b27c9

Please sign in to comment.