Skip to content

Commit

Permalink
Add omit details to promote payload for faster release promotions (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
Siva M authored Apr 26, 2024
1 parent b2fc8f5 commit d091fc7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
9 changes: 5 additions & 4 deletions pkg/kotsclient/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,11 @@ func (c *VendorV3Client) ListReleases(appID string) ([]types.ReleaseInfo, error)

func (c *VendorV3Client) PromoteRelease(appID string, sequence int64, label string, notes string, required bool, channelIDs ...string) error {
request := types.KotsPromoteReleaseRequest{
ReleaseNotes: notes,
VersionLabel: label,
IsRequired: required,
ChannelIDs: channelIDs,
ReleaseNotes: notes,
VersionLabel: label,
IsRequired: required,
ChannelIDs: channelIDs,
OmitDetailsInResponse: true,
}

path := fmt.Sprintf("/v3/app/%s/release/%v/promote", appID, sequence)
Expand Down
3 changes: 2 additions & 1 deletion pkg/kotsclient/release_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ func Test_PromoteRelease(t *testing.T) {
"channelIds": []string{
"replicated-cli-promote-release-unstable",
},
"ignoreWarnings": false,
"ignoreWarnings": false,
"omitDetailsInResponse": true,
},
}).
WillRespondWith(dsl.Response{
Expand Down
3 changes: 3 additions & 0 deletions pkg/types/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ type KotsPromoteReleaseRequest struct {
IsRequired bool `json:"isRequired"`
ChannelIDs []string `json:"channelIds"`
IgnoreWarnings bool `json:"ignoreWarnings"`

// Omits channels, charts, and compatibilityResults details in the response body
OmitDetailsInResponse bool `json:"omitDetailsInResponse"`
}

type KotsAppRelease struct {
Expand Down

0 comments on commit d091fc7

Please sign in to comment.