Skip to content

Commit 371f601

Browse files
committed
Advertise struct pointer requirement for Create
Make it explicit in the function comments that the "obj" argument of the Client interface's Create method must be a struct pointer, because implementers will store in it the object returned by the K8s API server.
1 parent 7399a3a commit 371f601

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/client/interfaces.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ type Reader interface {
6060

6161
// Writer knows how to create, delete, and update Kubernetes objects.
6262
type Writer interface {
63-
// Create saves the object obj in the Kubernetes cluster.
63+
// Create saves the object obj in the Kubernetes cluster. obj must be a
64+
// struct pointer so that obj can be updated with the content returned by the Server.
6465
Create(ctx context.Context, obj Object, opts ...CreateOption) error
6566

6667
// Delete deletes the given obj from Kubernetes cluster.

0 commit comments

Comments
 (0)