From d091fc73b77cd833c7cf2ae74ac4b3e501cf675b Mon Sep 17 00:00:00 2001 From: Siva M Date: Fri, 26 Apr 2024 14:50:24 -0500 Subject: [PATCH] Add omit details to promote payload for faster release promotions (#383) --- pkg/kotsclient/release.go | 9 +++++---- pkg/kotsclient/release_test.go | 3 ++- pkg/types/release.go | 3 +++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pkg/kotsclient/release.go b/pkg/kotsclient/release.go index 0c406c27e..ccf18db1e 100644 --- a/pkg/kotsclient/release.go +++ b/pkg/kotsclient/release.go @@ -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) diff --git a/pkg/kotsclient/release_test.go b/pkg/kotsclient/release_test.go index 5c00dc3d9..aa32eecab 100644 --- a/pkg/kotsclient/release_test.go +++ b/pkg/kotsclient/release_test.go @@ -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{ diff --git a/pkg/types/release.go b/pkg/types/release.go index fb1c9060a..74979c487 100644 --- a/pkg/types/release.go +++ b/pkg/types/release.go @@ -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 {