Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
2dd9b34d
Commit
2dd9b34d
authored
Mar 28, 2018
by
fibonacci1729
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream releases when listing
parent
d32a6ef6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
15 deletions
+38
-15
list.go
cmd/helm/list.go
+11
-7
client.go
pkg/helm/client.go
+16
-2
release_list.go
pkg/tiller/release_list.go
+11
-6
No files found.
cmd/helm/list.go
View file @
2dd9b34d
...
...
@@ -148,7 +148,7 @@ func (l *listCmd) run() error {
return
prettyError
(
err
)
}
if
len
(
res
.
Releases
)
==
0
{
if
len
(
res
.
GetReleases
()
)
==
0
{
return
nil
}
...
...
@@ -239,12 +239,16 @@ func formatList(rels []*release.Release, colWidth uint) string {
table
.
MaxColWidth
=
colWidth
table
.
AddRow
(
"NAME"
,
"REVISION"
,
"UPDATED"
,
"STATUS"
,
"CHART"
,
"NAMESPACE"
)
for
_
,
r
:=
range
rels
{
c
:=
fmt
.
Sprintf
(
"%s-%s"
,
r
.
Chart
.
Metadata
.
Name
,
r
.
Chart
.
Metadata
.
Version
)
t
:=
timeconv
.
String
(
r
.
Info
.
LastDeployed
)
s
:=
r
.
Info
.
Status
.
Code
.
String
()
v
:=
r
.
Version
n
:=
r
.
Namespace
table
.
AddRow
(
r
.
Name
,
v
,
t
,
s
,
c
,
n
)
md
:=
r
.
GetChart
()
.
GetMetadata
()
c
:=
fmt
.
Sprintf
(
"%s-%s"
,
md
.
GetName
(),
md
.
GetVersion
())
t
:=
"-"
if
tspb
:=
r
.
GetInfo
()
.
GetLastDeployed
();
tspb
!=
nil
{
t
=
timeconv
.
String
(
tspb
)
}
s
:=
r
.
GetInfo
()
.
GetStatus
()
.
GetCode
()
.
String
()
v
:=
r
.
GetVersion
()
n
:=
r
.
GetNamespace
()
table
.
AddRow
(
r
.
GetName
(),
v
,
t
,
s
,
c
,
n
)
}
return
table
.
String
()
}
pkg/helm/client.go
View file @
2dd9b34d
...
...
@@ -346,8 +346,22 @@ func (h *Client) list(ctx context.Context, req *rls.ListReleasesRequest) (*rls.L
if
err
!=
nil
{
return
nil
,
err
}
return
s
.
Recv
()
var
resp
*
rls
.
ListReleasesResponse
for
{
r
,
err
:=
s
.
Recv
()
if
err
==
io
.
EOF
{
break
}
if
err
!=
nil
{
return
nil
,
err
}
if
resp
==
nil
{
resp
=
r
continue
}
resp
.
Releases
=
append
(
resp
.
Releases
,
r
.
GetReleases
()[
0
])
}
return
resp
,
nil
}
// Executes tiller.InstallRelease RPC.
...
...
pkg/tiller/release_list.go
View file @
2dd9b34d
...
...
@@ -108,13 +108,18 @@ func (s *ReleaseServer) ListReleases(req *services.ListReleasesRequest, stream s
l
=
int64
(
len
(
rels
))
}
res
:=
&
services
.
ListReleasesResponse
{
Next
:
next
,
Count
:
l
,
Total
:
total
,
Releases
:
rels
,
for
i
:=
0
;
i
<
min
(
len
(
rels
),
int
(
req
.
Limit
));
i
++
{
res
:=
&
services
.
ListReleasesResponse
{
Next
:
next
,
Count
:
l
,
Total
:
total
,
Releases
:
[]
*
release
.
Release
{
rels
[
i
]},
}
if
err
:=
stream
.
Send
(
res
);
err
!=
nil
{
return
err
}
}
return
stream
.
Send
(
res
)
return
nil
}
func
filterByNamespace
(
namespace
string
,
rels
[]
*
release
.
Release
)
([]
*
release
.
Release
,
error
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment