From 081a0f46f5e22d24573cde795d1ae0a8931a1a35 Mon Sep 17 00:00:00 2001 From: Ivan Pirlik Date: Fri, 22 Dec 2017 19:00:51 +0000 Subject: [PATCH] Attempt decoding pod --- cli/pipeline/run.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cli/pipeline/run.go b/cli/pipeline/run.go index 7c53869..8bc2f59 100644 --- a/cli/pipeline/run.go +++ b/cli/pipeline/run.go @@ -19,6 +19,7 @@ import ( "io/ioutil" "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" + "k8s.io/client-go/kubernetes/scheme" ) var stepName string @@ -63,6 +64,12 @@ func runPipeline(path string) { } fmt.Printf("{}", list) for _, step := range pipeline.Steps { - compilePodTemplate(pipeline, &step) + stepPod := compilePodTemplate(pipeline, &step) + decode := scheme.Codecs.UniversalDeserializer().Decode + obj, groupVersionKind, err := decode([]byte(stepPod), nil, nil) + + if err != nil { + log.Fatal(fmt.Sprintf("Error while decoding YAML object. Err was: %s", err)) + } } }