Skip to content

Commit 4056cff

Browse files
authored
Merge pull request #166 from replicatedhq/todd-fix-promote-channel
Fix promote channel ouput
2 parents 926821d + bd81534 commit 4056cff

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ logs/
55
.DS_Store
66
bin/
77
vendor/
8+
.idea

cli/cmd/release_promote.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,24 @@ func (r *runners) releasePromote(cmd *cobra.Command, args []string) error {
3535
if err != nil {
3636
return fmt.Errorf("Failed to parse sequence argument %s", args[0])
3737
}
38-
chanID := args[1]
38+
channelName := args[1]
39+
newID := channelName
3940

4041
if r.appType != "ship" {
4142
// try to turn chanID into an actual id if it was a channel name
42-
newID, err := r.api.GetOrCreateChannelByName(r.appID, r.appType, r.appSlug, chanID, "", false)
43+
channelID, err := r.api.GetOrCreateChannelByName(r.appID, r.appType, r.appSlug, channelName, "", false)
4344
if err != nil {
4445
return errors.Wrapf(err, "unable to get channel ID from name")
4546
}
46-
chanID = newID.ID
47+
newID = channelID.ID
4748
}
4849

49-
if err := r.api.PromoteRelease(r.appID, r.appType, seq, r.args.releaseVersion, r.args.releaseNotes, !r.args.releaseOptional, chanID); err != nil {
50+
if err := r.api.PromoteRelease(r.appID, r.appType, seq, r.args.releaseVersion, r.args.releaseNotes, !r.args.releaseOptional, newID); err != nil {
5051
return err
5152
}
5253

5354
// ignore error since operation was successful
54-
fmt.Fprintf(r.w, "Channel %s successfully set to release %d\n", chanID, seq)
55+
fmt.Fprintf(r.w, "Channel %s successfully set to release %d\n", channelName, seq)
5556
r.w.Flush()
5657

5758
return nil

pkg/kotsclient/app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,5 @@ func (c *GraphQLClient) GetApp(appID string) (*types.App, error) {
105105
}
106106
}
107107

108-
return nil, errors.New("App not found")
108+
return nil, errors.New("App not found: " + appID)
109109
}

0 commit comments

Comments
 (0)