diff --git a/client/buildpack.go b/client/buildpack.go index ebf57a5..94c36b4 100644 --- a/client/buildpack.go +++ b/client/buildpack.go @@ -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 } diff --git a/client/buildpack_test.go b/client/buildpack_test.go index 7ffade2..5eaaa39 100644 --- a/client/buildpack_test.go +++ b/client/buildpack_test.go @@ -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) }, }, }