mirror of
https://github.com/nektos/act.git
synced 2026-04-26 01:15:51 +03:00
[PR #283] [MERGED] Container volumes sometimes reused even if configured not to #1401
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#1401
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/nektos/act/pull/283
Author: @N2D4
Created: 6/18/2020
Status: ✅ Merged
Merged: 6/18/2020
Merged by: @cplee
Base:
master← Head:master📝 Commits (1)
9ea4e93Fix container volumes being reused sometimes📊 Changes
4 files changed (+33 additions, -10 deletions)
View changed files
📝
pkg/container/docker_volume.go(+24 -2)📝
pkg/runner/expression_test.go(+2 -3)📝
pkg/runner/run_context.go(+3 -1)📝
pkg/runner/run_context_test.go(+4 -4)📄 Description
This can occur even without the
-rflag, but it's easier to reproduce like this..github/workflows/workflow.yaml:Now we run:
This is expected.
This is also expected, as the
-rflag means that the containers should be re-used; in other words, file.txt contains the original content from the last run, plus the new content from this run.This is unexpected; the
-rflag is no longer used, but the file system wasn't reset.This is expected; after the run without
-r, the volume was deleted from disk and this time we have a clean file system.The same thing happens even when not using
-rif the container clean-up doesn't run (eg. whenactis terminated in the middle of a build); the file system will persist. In the code, there's a safeguard which performs an additional clean-up before every build, but this safeguard only removes the container itself, not the volume associated with it (which is not anonymous). This PR fixes that by callingrunContext.stopJobContainer(...)instead ofcontainer.Remove()before the build, which removes both the container and the volume.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.