Skip to content

Commit

Permalink
Advertise struct pointer requirement for Create
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matteoolivi committed Oct 4, 2022
1 parent 7399a3a commit 371f601
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/client/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ type Reader interface {

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

// Delete deletes the given obj from Kubernetes cluster.
Expand Down

0 comments on commit 371f601

Please sign in to comment.