Skip to content

Commit 348548e

Browse files
authored
Merge pull request #1797 from pratikjagrut/list.max.flag
feat: add --max flag to list deployments command
2 parents 11a29a5 + c72bb2b commit 348548e

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

docs/pages/commands/devspace_list_deployments.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,3 @@ Shows the status of all deployments
4949
--var strings Variables to override during execution (e.g. --var=MYVAR=MYVALUE)
5050
--vars-secret string The secret to restore/save the variables from/to, if --restore-vars or --save-vars is enabled (default "devspace-vars")
5151
```
52-

pkg/devspace/helm/generic/generic.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ func (c *client) Exec(args []string, helmConfig *latest.HelmConfig) ([]byte, err
8585
args = append(args, "--kube-context", c.versionedClient.KubeContext())
8686
}
8787

88-
c.log.Infof("Execute '%s %s'", c.helmPath, strings.Join(args, " "))
88+
// disable log for list, because it prints same command multiple times if we've multiple deployments.
89+
if args[0] != "list" {
90+
c.log.Infof("Execute '%s %s'", c.helmPath, strings.Join(args, " "))
91+
}
8992
result, err := c.exec(c.helmPath, args).Output()
9093
if err != nil {
9194
if exitError, ok := err.(*exec.ExitError); ok {

pkg/devspace/helm/v2/install.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ func (c *client) ListReleases(helmConfig *latest.HelmConfig) ([]*types.Release,
215215
"list",
216216
"--tiller-namespace",
217217
c.tillerNamespace,
218+
"--max",
219+
strconv.Itoa(0),
218220
"--output",
219221
"json",
220222
}

pkg/devspace/helm/v3/client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"io/ioutil"
55
"os"
66
"path/filepath"
7+
"strconv"
78

89
"github.com/ghodss/yaml"
910
"github.com/loft-sh/devspace/pkg/devspace/config/versions/latest"
@@ -219,6 +220,8 @@ func (c *client) ListReleases(helmConfig *latest.HelmConfig) ([]*types.Release,
219220
"list",
220221
"--namespace",
221222
c.kubeClient.Namespace(),
223+
"--max",
224+
strconv.Itoa(0),
222225
"--output",
223226
"json",
224227
}

0 commit comments

Comments
 (0)