Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use SubResource method to implement Status method
  • Loading branch information
g7r authored and jmcshane committed Oct 3, 2022
commit 55b27c990df36754cbff9dcf440788df98c9dc06
2 changes: 1 addition & 1 deletion pkg/client/client.go
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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