Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Pods creation of WP services #3236

Merged
merged 3 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions pipeline/backend/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
zc-devs marked this conversation as resolved.
Show resolved Hide resolved
return err
Expand Down
4 changes: 2 additions & 2 deletions pipeline/backend/kubernetes/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down