internal/pkg: check filtered error
All checks were successful
Test / Create distribution (push) Successful in 58s
Test / Sandbox (push) Successful in 2m32s
Test / Hakurei (push) Successful in 3m31s
Test / ShareFS (push) Successful in 3m40s
Test / Sandbox (race detector) (push) Successful in 5m2s
Test / Hakurei (race detector) (push) Successful in 5m50s
Test / Flake checks (push) Successful in 1m30s
All checks were successful
Test / Create distribution (push) Successful in 58s
Test / Sandbox (push) Successful in 2m32s
Test / Hakurei (push) Successful in 3m31s
Test / ShareFS (push) Successful in 3m40s
Test / Sandbox (race detector) (push) Successful in 5m2s
Test / Hakurei (race detector) (push) Successful in 5m50s
Test / Flake checks (push) Successful in 1m30s
This avoids filtering some unrelated os.ErrExist. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -163,8 +163,12 @@ func (t *TContext) destroy(errP *error) {
|
||||
if chmodErr != nil || removeErr != nil {
|
||||
*errP = errors.Join(*errP, chmodErr, removeErr)
|
||||
} else if errors.Is(*errP, os.ErrExist) {
|
||||
// two artifacts may be backed by the same file
|
||||
*errP = nil
|
||||
var linkError *os.LinkError
|
||||
if errors.As(*errP, &linkError) && linkError != nil &&
|
||||
linkError.Op == "rename" {
|
||||
// two artifacts may be backed by the same file
|
||||
*errP = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user