Skip to content

Commit

Permalink
fix: Return jobGuid on buildpack delete
Browse files Browse the repository at this point in the history
Signed-off-by: Ray <debaditya.ray@sap.com>
  • Loading branch information
Dray56 authored and debTheRay committed Jun 18, 2024
1 parent a5dc9be commit 5d36d83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions client/buildpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ func (c *BuildpackClient) Create(ctx context.Context, r *resource.BuildpackCreat
return &bp, nil
}

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

// First returns the first buildpack matching the options or an error when less than 1 match
Expand Down
2 changes: 1 addition & 1 deletion client/buildpack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TestBuildpacks(t *testing.T) {
Status: http.StatusAccepted,
},
Action: func(c *Client, t *testing.T) (any, error) {
return nil, c.Buildpacks.Delete(context.Background(), "6f3c68d0-e119-4ca2-8ce4-83661ad6e0eb")
return c.Buildpacks.Delete(context.Background(), "6f3c68d0-e119-4ca2-8ce4-83661ad6e0eb")
},
},
{
Expand Down

0 comments on commit 5d36d83

Please sign in to comment.