Skip to content

Commit

Permalink
Merge pull request #418 from Dray56/buildpack_update_stack
Browse files Browse the repository at this point in the history
fix : Remove omitempty from stack attribute in buildpack
  • Loading branch information
sneal authored Jun 24, 2024
2 parents 9eb287b + 5aed4ee commit 0893f85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions client/buildpack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
},
Expand Down
2 changes: 1 addition & 1 deletion resource/buildpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down

0 comments on commit 0893f85

Please sign in to comment.