mirror of https://github.com/helm/helm
Merge pull request #6550 from thomastaylor312/fix/missing_debug
fix(cmd): Fix all the outputspull/6596/head
commit
0210d43a66
@ -1,3 +1,3 @@
|
||||
REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION
|
||||
3 1977-09-02 22:04:05 +0000 UTC superseded foo-0.1.0-beta.1 1.0 Release mock
|
||||
4 1977-09-02 22:04:05 +0000 UTC deployed foo-0.1.0-beta.1 1.0 Release mock
|
||||
REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION
|
||||
3 Fri Sep 2 22:04:05 1977 superseded foo-0.1.0-beta.1 1.0 Release mock
|
||||
4 Fri Sep 2 22:04:05 1977 deployed foo-0.1.0-beta.1 1.0 Release mock
|
||||
|
@ -1 +1 @@
|
||||
[{"revision":3,"updated":"1977-09-02 22:04:05 +0000 UTC","status":"superseded","chart":"foo-0.1.0-beta.1","app_version":"1.0","description":"Release mock"},{"revision":4,"updated":"1977-09-02 22:04:05 +0000 UTC","status":"deployed","chart":"foo-0.1.0-beta.1","app_version":"1.0","description":"Release mock"}]
|
||||
[{"revision":3,"updated":"1977-09-02T22:04:05Z","status":"superseded","chart":"foo-0.1.0-beta.1","app_version":"1.0","description":"Release mock"},{"revision":4,"updated":"1977-09-02T22:04:05Z","status":"deployed","chart":"foo-0.1.0-beta.1","app_version":"1.0","description":"Release mock"}]
|
||||
|
@ -1,5 +1,5 @@
|
||||
REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION
|
||||
1 1977-09-02 22:04:05 +0000 UTC superseded foo-0.1.0-beta.1 1.0 Release mock
|
||||
2 1977-09-02 22:04:05 +0000 UTC superseded foo-0.1.0-beta.1 1.0 Release mock
|
||||
3 1977-09-02 22:04:05 +0000 UTC superseded foo-0.1.0-beta.1 1.0 Release mock
|
||||
4 1977-09-02 22:04:05 +0000 UTC deployed foo-0.1.0-beta.1 1.0 Release mock
|
||||
REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION
|
||||
1 Fri Sep 2 22:04:05 1977 superseded foo-0.1.0-beta.1 1.0 Release mock
|
||||
2 Fri Sep 2 22:04:05 1977 superseded foo-0.1.0-beta.1 1.0 Release mock
|
||||
3 Fri Sep 2 22:04:05 1977 superseded foo-0.1.0-beta.1 1.0 Release mock
|
||||
4 Fri Sep 2 22:04:05 1977 deployed foo-0.1.0-beta.1 1.0 Release mock
|
||||
|
@ -1,4 +1,5 @@
|
||||
NAME: aeneas
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 1
|
||||
|
@ -1,4 +1,5 @@
|
||||
NAME: FOOBAR
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 1
|
||||
|
@ -1,4 +1,5 @@
|
||||
NAME: aeneas
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 1
|
||||
|
@ -1,4 +1,5 @@
|
||||
NAME: virgil
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 1
|
||||
|
@ -1,4 +1,5 @@
|
||||
NAME: virgil
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 1
|
||||
|
@ -1,4 +1,5 @@
|
||||
NAME: foobar
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 1
|
||||
|
@ -1,4 +1,5 @@
|
||||
NAME: virgil
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 1
|
||||
|
@ -1,4 +1,5 @@
|
||||
NAME: virgil
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 1
|
||||
|
@ -1,4 +1,5 @@
|
||||
NAME: apollo
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 1
|
||||
|
@ -1,4 +1,5 @@
|
||||
NAME: aeneas
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 1
|
||||
|
@ -1,4 +1,5 @@
|
||||
NAME: schema
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 1
|
||||
|
@ -1,6 +1,7 @@
|
||||
NAME: flummoxed-chickadee
|
||||
LAST DEPLOYED: 2016-01-16 00:00:00 +0000 UTC
|
||||
LAST DEPLOYED: Sat Jan 16 00:00:00 2016
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 0
|
||||
NOTES:
|
||||
release notes
|
||||
|
@ -1,14 +1,15 @@
|
||||
NAME: flummoxed-chickadee
|
||||
LAST DEPLOYED: 2016-01-16 00:00:00 +0000 UTC
|
||||
LAST DEPLOYED: Sat Jan 16 00:00:00 2016
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 0
|
||||
TEST SUITE: passing-test
|
||||
Last Started: 2006-01-02 15:04:05 +0000 UTC
|
||||
Last Completed: 2006-01-02 15:04:07 +0000 UTC
|
||||
Last Started: Mon Jan 2 15:04:05 2006
|
||||
Last Completed: Mon Jan 2 15:04:07 2006
|
||||
Phase: Succeeded
|
||||
|
||||
TEST SUITE: failing-test
|
||||
Last Started: 2006-01-02 15:10:05 +0000 UTC
|
||||
Last Completed: 2006-01-02 15:10:07 +0000 UTC
|
||||
Last Started: Mon Jan 2 15:10:05 2006
|
||||
Last Completed: Mon Jan 2 15:10:07 2006
|
||||
Phase: Failed
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
NAME: flummoxed-chickadee
|
||||
LAST DEPLOYED: 2016-01-16 00:00:00 +0000 UTC
|
||||
LAST DEPLOYED: Sat Jan 16 00:00:00 2016
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 0
|
||||
|
@ -1,4 +1,5 @@
|
||||
NAME: schema
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 1
|
||||
|
@ -1,5 +1,6 @@
|
||||
Release "crazy-bunny" has been upgraded. Happy Helming!
|
||||
NAME: crazy-bunny
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 2
|
||||
|
@ -1,5 +1,6 @@
|
||||
Release "zany-bunny" has been upgraded. Happy Helming!
|
||||
NAME: zany-bunny
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 2
|
||||
|
@ -1,5 +1,6 @@
|
||||
Release "funny-bunny" has been upgraded. Happy Helming!
|
||||
NAME: funny-bunny
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 5
|
||||
|
@ -1,5 +1,6 @@
|
||||
Release "funny-bunny" has been upgraded. Happy Helming!
|
||||
NAME: funny-bunny
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 6
|
||||
|
@ -1,5 +1,6 @@
|
||||
Release "funny-bunny" has been upgraded. Happy Helming!
|
||||
NAME: funny-bunny
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 4
|
||||
|
@ -1,5 +1,6 @@
|
||||
Release "crazy-bunny" has been upgraded. Happy Helming!
|
||||
NAME: crazy-bunny
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 3
|
||||
|
@ -1,5 +1,6 @@
|
||||
Release "funny-bunny" has been upgraded. Happy Helming!
|
||||
NAME: funny-bunny
|
||||
LAST DEPLOYED: 1977-09-02 22:04:05 +0000 UTC
|
||||
LAST DEPLOYED: Fri Sep 2 22:04:05 1977
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 3
|
||||
|
@ -1,76 +0,0 @@
|
||||
/*
|
||||
Copyright The Helm Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package action
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"helm.sh/helm/v3/pkg/release"
|
||||
)
|
||||
|
||||
// PrintRelease prints info about a release
|
||||
func PrintRelease(out io.Writer, rel *release.Release) {
|
||||
if rel == nil {
|
||||
return
|
||||
}
|
||||
fmt.Fprintf(out, "NAME: %s\n", rel.Name)
|
||||
if !rel.Info.LastDeployed.IsZero() {
|
||||
fmt.Fprintf(out, "LAST DEPLOYED: %s\n", rel.Info.LastDeployed)
|
||||
}
|
||||
fmt.Fprintf(out, "NAMESPACE: %s\n", rel.Namespace)
|
||||
fmt.Fprintf(out, "STATUS: %s\n", rel.Info.Status.String())
|
||||
|
||||
executions := executionsByHookEvent(rel)
|
||||
if tests, ok := executions[release.HookTest]; ok {
|
||||
for _, h := range tests {
|
||||
// Don't print anything if hook has not been initiated
|
||||
if h.LastRun.StartedAt.IsZero() {
|
||||
continue
|
||||
}
|
||||
fmt.Fprintf(out, "TEST SUITE: %s\n%s\n%s\n%s\n\n",
|
||||
h.Name,
|
||||
fmt.Sprintf("Last Started: %s", h.LastRun.StartedAt),
|
||||
fmt.Sprintf("Last Completed: %s", h.LastRun.CompletedAt),
|
||||
fmt.Sprintf("Phase: %s", h.LastRun.Phase),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if strings.EqualFold(rel.Info.Description, "Dry run complete") {
|
||||
fmt.Fprintf(out, "MANIFEST:\n%s\n", rel.Manifest)
|
||||
}
|
||||
|
||||
if len(rel.Info.Notes) > 0 {
|
||||
fmt.Fprintf(out, "NOTES:\n%s\n", strings.TrimSpace(rel.Info.Notes))
|
||||
}
|
||||
}
|
||||
|
||||
func executionsByHookEvent(rel *release.Release) map[release.HookEvent][]*release.Hook {
|
||||
result := make(map[release.HookEvent][]*release.Hook)
|
||||
for _, h := range rel.Hooks {
|
||||
for _, e := range h.Events {
|
||||
executions, ok := result[e]
|
||||
if !ok {
|
||||
executions = []*release.Hook{}
|
||||
}
|
||||
result[e] = append(executions, h)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
Loading…
Reference in new issue