Skip to content

Kubernetes: detached steps are no services#6435

Merged
6543 merged 3 commits into
woodpecker-ci:mainfrom
6543-forks:kube_not-all-detached-are-services
Apr 15, 2026
Merged

Kubernetes: detached steps are no services#6435
6543 merged 3 commits into
woodpecker-ci:mainfrom
6543-forks:kube_not-all-detached-are-services

Conversation

@6543
Copy link
Copy Markdown
Member

@6543 6543 commented Apr 13, 2026

the implementation just assumes, that detached steps are services, witch is wrong

close #5124

@6543 6543 added bug Something isn't working backend/kubernetes build_pr_images If set, the CI will build images for this PR and push to Dockerhub labels Apr 13, 2026
@xoxys
Copy link
Copy Markdown
Member

xoxys commented Apr 15, 2026

@MartinSchmidt can you take a look?

@qwerty287 qwerty287 changed the title Kubernetes: detached steps are nos services Kubernetes: detached steps are no services Apr 15, 2026
@xoxys
Copy link
Copy Markdown
Member

xoxys commented Apr 15, 2026

Not checked the implementation but how are detached steps now work on kunbernetes. They will be regular pods? Containers in the workflow pod? Do we ensure not not end up with orphanded resources after pipeline exited?

@6543
Copy link
Copy Markdown
Member Author

6543 commented Apr 15, 2026

// we make sure cleanup always happens
defer func() {
ctx := runnerCtx //nolint:contextcheck
if ctx.Err() != nil {
// runnerCtx itself is done — fall back to a short-lived shutdown context.
ctx = GetShutdownCtx()
}
if err := r.engine.DestroyWorkflow(ctx, r.spec, r.taskUUID); err != nil {
logger.Error().Err(err).Msg("could not destroy workflow")
}
}()

// DestroyWorkflow destroys the pipeline environment.
func (e *kube) DestroyWorkflow(ctx context.Context, conf *types.Config, taskUUID string) error {
log.Trace().Str("taskUUID", taskUUID).Msg("deleting Kubernetes primitives")
for _, stage := range conf.Stages {
for _, step := range stage.Steps {
err := stopPod(ctx, e, step, defaultDeleteOptions)
if err != nil {
return err
}
}
}

Copy link
Copy Markdown
Member

@xoxys xoxys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code lgtm but untested. Thanks for the refs should work.as expected for detached steps.

@6543 6543 merged commit e173bed into woodpecker-ci:main Apr 15, 2026
6 of 7 checks passed
@6543 6543 deleted the kube_not-all-detached-are-services branch April 15, 2026 13:29
@woodpecker-bot woodpecker-bot mentioned this pull request Apr 15, 2026
1 task
@woodpecker-bot woodpecker-bot mentioned this pull request Apr 27, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend/kubernetes bug Something isn't working build_pr_images If set, the CI will build images for this PR and push to Dockerhub

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detach action conflicts with Kubernetes backend

2 participants