fix: working my way towards a stable k8s release
This commit is contained in:
@@ -659,13 +659,7 @@ func handleBackendImageDownload(ctx context.Context, images string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func deployK8sWorker(image string, identifier string, env []string, executionRequest shuffle.ExecutionRequest) error {
|
||||||
func deployWorker(image string, identifier string, env []string, executionRequest shuffle.ExecutionRequest) error {
|
|
||||||
if len(os.Getenv("REGISTRY_URL")) > 0 && os.Getenv("REGISTRY_URL") != "" {
|
|
||||||
env = append(env, fmt.Sprintf("REGISTRY_URL=%s", os.Getenv("REGISTRY_URL")))
|
|
||||||
}
|
|
||||||
|
|
||||||
if isKubernetes == "true" {
|
|
||||||
env = append(env, fmt.Sprintf("IS_KUBERNETES=true"))
|
env = append(env, fmt.Sprintf("IS_KUBERNETES=true"))
|
||||||
env = append(env, fmt.Sprintf("KUBERNETES_NAMESPACE=%s", os.Getenv("KUBERNETES_NAMESPACE")))
|
env = append(env, fmt.Sprintf("KUBERNETES_NAMESPACE=%s", os.Getenv("KUBERNETES_NAMESPACE")))
|
||||||
|
|
||||||
@@ -771,7 +765,7 @@ func deployWorker(image string, identifier string, env []string, executionReques
|
|||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
if len(podname) > 0 {
|
if len(podname) > 0 {
|
||||||
currentPodStatus, err := shuffle.GetCurrentPodNetworkConfig(ctx, clientset, kubernetesNamespace, podname)
|
_, err := shuffle.GetCurrentPodNetworkConfig(ctx, clientset, kubernetesNamespace, podname)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[ERROR] Failed getting current pod network: %s", err)
|
log.Printf("[ERROR] Failed getting current pod network: %s", err)
|
||||||
} else {
|
} else {
|
||||||
@@ -804,7 +798,7 @@ func deployWorker(image string, identifier string, env []string, executionReques
|
|||||||
|
|
||||||
// Get current pod's network so we can make the pod in it
|
// Get current pod's network so we can make the pod in it
|
||||||
|
|
||||||
networks, err := clientset.CoreV1().Pods(kubernetesNamespace).List(context.Background(), metav1.ListOptions{})
|
_, err = clientset.CoreV1().Pods(kubernetesNamespace).List(context.Background(), metav1.ListOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[ERROR] Failed listing pods: %s", err)
|
log.Printf("[ERROR] Failed listing pods: %s", err)
|
||||||
}
|
}
|
||||||
@@ -818,6 +812,21 @@ func deployWorker(image string, identifier string, env []string, executionReques
|
|||||||
|
|
||||||
log.Printf("[INFO] Created pod %q in namespace %q\n", createdPod.Name, createdPod.Namespace)
|
log.Printf("[INFO] Created pod %q in namespace %q\n", createdPod.Name, createdPod.Namespace)
|
||||||
return nil
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func deployWorker(image string, identifier string, env []string, executionRequest shuffle.ExecutionRequest) error {
|
||||||
|
if len(os.Getenv("REGISTRY_URL")) > 0 && os.Getenv("REGISTRY_URL") != "" {
|
||||||
|
env = append(env, fmt.Sprintf("REGISTRY_URL=%s", os.Getenv("REGISTRY_URL")))
|
||||||
|
}
|
||||||
|
|
||||||
|
if isKubernetes == "true" {
|
||||||
|
err := deployK8sWorker(image, identifier, env, executionRequest)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("[ERROR] Failed deploying Kubernetes worker: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Binds is the actual "-v" volume.
|
// Binds is the actual "-v" volume.
|
||||||
|
|||||||
Reference in New Issue
Block a user