From 072fa29f4a40239a85b0d3cfe5ffe7eb0680445e Mon Sep 17 00:00:00 2001 From: Thomas Anderson <127358482+zc-devs@users.noreply.github.com> Date: Sun, 21 Jan 2024 05:56:37 +0300 Subject: [PATCH] Fixed Pods creation of WP services (#3236) Closes #3178 --- pipeline/backend/kubernetes/kubernetes.go | 10 ---------- pipeline/backend/kubernetes/pod.go | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/pipeline/backend/kubernetes/kubernetes.go b/pipeline/backend/kubernetes/kubernetes.go index 8b8b57676..4010cd5aa 100644 --- a/pipeline/backend/kubernetes/kubernetes.go +++ b/pipeline/backend/kubernetes/kubernetes.go @@ -204,11 +204,6 @@ func (e *kube) SetupWorkflow(ctx context.Context, conf *types.Config, taskUUID s // Start the pipeline step. func (e *kube) StartStep(ctx context.Context, step *types.Step, taskUUID string) error { - if step.Type == types.StepTypeService { - // a service should be started by SetupWorkflow so we can ignore it - log.Trace().Msgf("StartStep got service '%s', ignoring it.", step.Name) - return nil - } log.Trace().Str("taskUUID", taskUUID).Msgf("starting step: %s", step.Name) _, err := startPod(ctx, e, step) return err @@ -353,11 +348,6 @@ func (e *kube) TailStep(ctx context.Context, step *types.Step, taskUUID string) } func (e *kube) DestroyStep(ctx context.Context, step *types.Step, taskUUID string) error { - if step.Type == types.StepTypeService { - // a service should be stopped by DestroyWorkflow so we can ignore it - log.Trace().Msgf("destroyStep got service '%s', ignoring it.", step.Name) - return nil - } log.Trace().Str("taskUUID", taskUUID).Msgf("Stopping step: %s", step.Name) err := stopPod(ctx, e, step, defaultDeleteOptions) return err diff --git a/pipeline/backend/kubernetes/pod.go b/pipeline/backend/kubernetes/pod.go index 49f7ca6e0..930098bb4 100644 --- a/pipeline/backend/kubernetes/pod.go +++ b/pipeline/backend/kubernetes/pod.go @@ -442,7 +442,7 @@ func mapToEnvVars(m map[string]string) []v1.EnvVar { } func startPod(ctx context.Context, engine *kube, step *types.Step) (*v1.Pod, error) { - podName, err := podName(step) + podName, err := stepToPodName(step) if err != nil { return nil, err } @@ -457,7 +457,7 @@ func startPod(ctx context.Context, engine *kube, step *types.Step) (*v1.Pod, err } func stopPod(ctx context.Context, engine *kube, step *types.Step, deleteOpts metav1.DeleteOptions) error { - podName, err := podName(step) + podName, err := stepToPodName(step) if err != nil { return err }