From 5aed4eee6fa973cc942311090c59af95fd760009 Mon Sep 17 00:00:00 2001 From: Debaditya Ray Date: Wed, 19 Jun 2024 10:15:23 +0530 Subject: [PATCH] fix # Remove omitempty from stack attribute in buildpack Signed-off-by: Ray --- client/buildpack_test.go | 9 +++++++-- resource/buildpack.go | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/client/buildpack_test.go b/client/buildpack_test.go index 32ac461..0cf858e 100644 --- a/client/buildpack_test.go +++ b/client/buildpack_test.go @@ -85,11 +85,16 @@ func TestBuildpacks(t *testing.T) { Endpoint: "/v3/buildpacks/6f3c68d0-e119-4ca2-8ce4-83661ad6e0eb", Output: g.Single(buildpack), Status: http.StatusOK, - PostForm: `{ "position": 1 }`, + PostForm: `{ + "position": 1, + "stack" : "cflinuxfs4" + }`, }, Expected: buildpack, Action: func(c *Client, t *testing.T) (any, error) { - r := resource.NewBuildpackUpdate().WithPosition(1) + r := resource.NewBuildpackUpdate(). + WithPosition(1). + WithStack("cflinuxfs4") return c.Buildpacks.Update(context.Background(), "6f3c68d0-e119-4ca2-8ce4-83661ad6e0eb", r) }, }, diff --git a/resource/buildpack.go b/resource/buildpack.go index 3946fe7..2d8b212 100644 --- a/resource/buildpack.go +++ b/resource/buildpack.go @@ -18,7 +18,7 @@ type BuildpackCreateOrUpdate struct { Position *int `json:"position,omitempty"` // The order in which the buildpacks are checked during buildpack auto-detection Enabled *bool `json:"enabled,omitempty"` // Whether the buildpack can be used for staging Locked *bool `json:"locked,omitempty"` // Whether the buildpack is locked to prevent updating the bits - Stack *string `json:"stack,omitempty"` // The name of the stack that the buildpack will use + Stack *string `json:"stack"` // The name of the stack that the buildpack will use Metadata *Metadata `json:"metadata,omitempty"` }