Skip to content

Commit 9eb287b

Browse files
authored
Merge pull request #416 from Dray56/buildpack_delete
fix: Return jobGuid on buildpack delete
2 parents d240cc3 + 5d36d83 commit 9eb287b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

client/buildpack.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@ func (c *BuildpackClient) Create(ctx context.Context, r *resource.BuildpackCreat
4040
return &bp, nil
4141
}
4242

43-
// Delete the specified buildpack
44-
func (c *BuildpackClient) Delete(ctx context.Context, guid string) error {
45-
_, err := c.client.delete(ctx, path.Format("/v3/buildpacks/%s", guid))
46-
return err
43+
// Delete the specified buildpack returning the async deletion jobGUID
44+
func (c *BuildpackClient) Delete(ctx context.Context, guid string) (string, error) {
45+
return c.client.delete(ctx, path.Format("/v3/buildpacks/%s", guid))
4746
}
4847

4948
// First returns the first buildpack matching the options or an error when less than 1 match

client/buildpack_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func TestBuildpacks(t *testing.T) {
5151
Status: http.StatusAccepted,
5252
},
5353
Action: func(c *Client, t *testing.T) (any, error) {
54-
return nil, c.Buildpacks.Delete(context.Background(), "6f3c68d0-e119-4ca2-8ce4-83661ad6e0eb")
54+
return c.Buildpacks.Delete(context.Background(), "6f3c68d0-e119-4ca2-8ce4-83661ad6e0eb")
5555
},
5656
},
5757
{

0 commit comments

Comments
 (0)