Skip to content

Commit

Permalink
🐛 Remove duplicated list of upgradable releases (#688)
Browse files Browse the repository at this point in the history
* Remove duplicated list of upgradable releases

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Make list output consistent

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
  • Loading branch information
mauromorales committed Jan 19, 2023
1 parent d24f2d6 commit 3b4e7b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
8 changes: 4 additions & 4 deletions cmd/agent/main.go
Expand Up @@ -49,7 +49,7 @@ To retrieve all the available versions, use "kairos upgrade list-releases"
$ kairos upgrade list-releases
See https://kairos.io/after_install/upgrades/#manual for documentation.
See https://kairos.io/docs/upgrade/manual/ for documentation.
`,
Subcommands: []cli.Command{
Expand All @@ -64,9 +64,9 @@ See https://kairos.io/after_install/upgrades/#manual for documentation.
Description: `List all available releases versions`,
Action: func(c *cli.Context) error {
releases := agent.ListReleases()
releases = utils.ListOutput(releases, c.String("output"))
for _, r := range releases {
fmt.Println(r)
list := utils.ListOutput(releases, c.String("output"))
for _, i := range list {
fmt.Println(i)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/docs/Upgrade/manual.md
Expand Up @@ -8,7 +8,7 @@ description: >

Upgrades can be run manually from the terminal.

Kairos images are released on [quay.io](https://quay.io/repository/kairos/kairos).
Kairos images are released on [quay.io](https://quay.io/organization/kairos).

## List available versions

Expand Down
4 changes: 0 additions & 4 deletions pkg/utils/strings.go
Expand Up @@ -2,7 +2,6 @@ package utils

import (
"encoding/json"
"fmt"
"math/rand"
"strings"
"time"
Expand Down Expand Up @@ -33,9 +32,6 @@ func ListOutput(rels []string, output string) []string {
d, _ := json.Marshal(rels)
return []string{string(d)}
default:
for _, r := range rels {
fmt.Println(r)
}
return rels
}
}

0 comments on commit 3b4e7b5

Please sign in to comment.