Skip to content

Commit 0893f85

Browse files
authored
Merge pull request #418 from Dray56/buildpack_update_stack
fix : Remove omitempty from stack attribute in buildpack
2 parents 9eb287b + 5aed4ee commit 0893f85

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

client/buildpack_test.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,16 @@ func TestBuildpacks(t *testing.T) {
8585
Endpoint: "/v3/buildpacks/6f3c68d0-e119-4ca2-8ce4-83661ad6e0eb",
8686
Output: g.Single(buildpack),
8787
Status: http.StatusOK,
88-
PostForm: `{ "position": 1 }`,
88+
PostForm: `{
89+
"position": 1,
90+
"stack" : "cflinuxfs4"
91+
}`,
8992
},
9093
Expected: buildpack,
9194
Action: func(c *Client, t *testing.T) (any, error) {
92-
r := resource.NewBuildpackUpdate().WithPosition(1)
95+
r := resource.NewBuildpackUpdate().
96+
WithPosition(1).
97+
WithStack("cflinuxfs4")
9398
return c.Buildpacks.Update(context.Background(), "6f3c68d0-e119-4ca2-8ce4-83661ad6e0eb", r)
9499
},
95100
},

resource/buildpack.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type BuildpackCreateOrUpdate struct {
1818
Position *int `json:"position,omitempty"` // The order in which the buildpacks are checked during buildpack auto-detection
1919
Enabled *bool `json:"enabled,omitempty"` // Whether the buildpack can be used for staging
2020
Locked *bool `json:"locked,omitempty"` // Whether the buildpack is locked to prevent updating the bits
21-
Stack *string `json:"stack,omitempty"` // The name of the stack that the buildpack will use
21+
Stack *string `json:"stack"` // The name of the stack that the buildpack will use
2222
Metadata *Metadata `json:"metadata,omitempty"`
2323
}
2424

0 commit comments

Comments
 (0)