TEST: cleanup code

Signed-off-by: Jeff Knurek <j.knurek@travelaudience.com>
pull/6612/head
Jeff Knurek 5 years ago committed by Matthew Fisher
parent b94608388e
commit 6529abe85f
No known key found for this signature in database
GPG Key ID: 92AA783CBAAE8E3B

@ -23,7 +23,7 @@ import (
"sync"
"time"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/helm/pkg/proto/hapi/release"
"k8s.io/helm/pkg/proto/hapi/services"
@ -127,6 +127,7 @@ func (env *Environment) DeleteTestPods(testManifests []string) {
}
}
// GetLogs collects the logs from the pods created in testManifests
func (env *Environment) GetLogs(testManifests []string) {
for _, testManifest := range testManifests {
infos, err := env.KubeClient.Build(env.Namespace, bytes.NewBufferString(testManifest))
@ -134,6 +135,10 @@ func (env *Environment) GetLogs(testManifests []string) {
env.streamError(err.Error())
continue
}
if len(infos) < 1 {
env.streamError(fmt.Sprint("Pod manifest is invalid. Unable to obtain the logs"))
continue
}
podName := infos[0].Object.(*v1.Pod).Name
logs, err := env.KubeClient.GetPodLogs(podName, env.Namespace)
if err != nil {

Loading…
Cancel
Save