Skip to content

Commit

Permalink
Merge pull request #420 from Dray56/buildpack_upload_filename
Browse files Browse the repository at this point in the history
fix: Make buildpack filename customisable
  • Loading branch information
sneal authored Jun 24, 2024
2 parents 0893f85 + e590a4b commit 9f33372
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions client/buildpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ func (c *BuildpackClient) Update(ctx context.Context, guid string, r *resource.B
}

// Upload a gzip compressed (zip) file containing a Cloud Foundry compatible buildpack
func (c *BuildpackClient) Upload(ctx context.Context, guid string, zipFile io.Reader) (string, *resource.Buildpack, error) {
func (c *BuildpackClient) Upload(ctx context.Context, guid string, fileName string, zipFile io.Reader) (string, *resource.Buildpack, error) {
p := path.Format("/v3/buildpacks/%s/upload", guid)
var b resource.Buildpack
jobGUID, err := c.client.postFileUpload(ctx, p, "bits", "buildpack.zip", zipFile, &b)
jobGUID, err := c.client.postFileUpload(ctx, p, "bits", fileName, zipFile, &b)
if err != nil {
return "", nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion client/buildpack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func TestBuildpacks(t *testing.T) {
Expected2: buildpack,
Action2: func(c *Client, t *testing.T) (any, any, error) {
zipFile := strings.NewReader("bp")
return c.Buildpacks.Upload(context.Background(), "6f3c68d0-e119-4ca2-8ce4-83661ad6e0eb", zipFile)
return c.Buildpacks.Upload(context.Background(), "6f3c68d0-e119-4ca2-8ce4-83661ad6e0eb", "buildpack.zip", zipFile)
},
},
}
Expand Down

0 comments on commit 9f33372

Please sign in to comment.