Properly set Job on Executor... D'oh

This commit is contained in:
James Munnelly
2015-09-10 21:22:38 +01:00
parent b8e46847d9
commit 9dece22ac0
+4 -2
View File
@@ -31,6 +31,7 @@ type KubernetesExecutor struct {
} }
func (e *KubernetesExecutor) createPod() *api.Pod { func (e *KubernetesExecutor) createPod() *api.Pod {
fmt.Println("Args: ", e.Job.Args)
return &api.Pod{ return &api.Pod{
TypeMeta: api.TypeMeta{ TypeMeta: api.TypeMeta{
Kind: "Pod", Kind: "Pod",
@@ -66,7 +67,6 @@ func (e *KubernetesExecutor) createPod() *api.Pod {
api.Container{ api.Container{
Name: podBasename, Name: podBasename,
Image: e.Image, Image: e.Image,
Command: e.Job.Command,
Args: e.Job.Args, Args: e.Job.Args,
VolumeMounts: []api.VolumeMount{ VolumeMounts: []api.VolumeMount{
api.VolumeMount{ api.VolumeMount{
@@ -159,11 +159,13 @@ func (e *KubernetesExecutor) WaitForState(targetState executors.ExecutorPhase) e
func init() { func init() {
common.RegisterExecutor("kubernetes", common.ExecutorFactory{ common.RegisterExecutor("kubernetes", common.ExecutorFactory{
Create: func(j executors.Job) executors.Executor { Create: func(j executors.Job) executors.Executor {
return &KubernetesExecutor{ e := &KubernetesExecutor{
Host: kubernetesHost, Host: kubernetesHost,
Namespace: kubernetesNamespace, Namespace: kubernetesNamespace,
Image: dockerImage, Image: dockerImage,
} }
e.Job = j
return e
}, },
}) })
} }