Skip to content

Commit

Permalink
Update to use GoVersion in pods create.
Browse files Browse the repository at this point in the history
  • Loading branch information
blakerouse committed May 4, 2020
1 parent 7fcad4f commit 36da24c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dev-tools/mage/kubernetes/kuberemote.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ import (
"k8s.io/client-go/tools/portforward"
watchtools "k8s.io/client-go/tools/watch"
"k8s.io/client-go/transport/spdy"

"github.com/elastic/beats/v7/dev-tools/mage"
)

const sshBitSize = 4096
Expand Down Expand Up @@ -204,8 +206,13 @@ func (r *KubeRemote) syncServiceAccount() error {

// createPod creates the pod.
func (r *KubeRemote) createPod(env map[string]string, cmd ...string) (*apiv1.Pod, error) {
version, err := mage.GoVersion()
if err != nil {
return nil, err
}
image := fmt.Sprintf("golang:%s", version)
r.deletePod() // ensure it doesn't already exist
return r.cs.CoreV1().Pods(r.namespace).Create(createPodManifest(r.name, "golang:1.13.9", env, cmd, r.workDir, r.destDir, r.secretName, r.svcAccName))
return r.cs.CoreV1().Pods(r.namespace).Create(createPodManifest(r.name, image, env, cmd, r.workDir, r.destDir, r.secretName, r.svcAccName))
}

// deletePod deletes the pod.
Expand Down

0 comments on commit 36da24c

Please sign in to comment.