Move attempt views to workspace path ownership
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/artifacts"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/fileops"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/manifest"
|
||||
)
|
||||
@@ -47,7 +48,7 @@ func (cleanupStage) Run(ctx context.Context, env *Env, m *manifest.Manifest) (*S
|
||||
}
|
||||
_, err := inspectCleanupTarget(target.root, target.target)
|
||||
if err == nil {
|
||||
err = fileops.RemoveManagedAttemptViews(filepath.Dir(target.target), cleanupManagedNames())
|
||||
err = artifacts.RemoveManagedAttemptViews(filepath.Dir(target.target), cleanupManagedNames())
|
||||
if errors.Is(err, os.ErrNotExist) {
|
||||
err = nil
|
||||
}
|
||||
@@ -165,7 +166,7 @@ func inspectCleanupTarget(workspaceRoot, runsDir string) (bool, error) {
|
||||
if runsExist && (!info.IsDir() || info.Mode()&os.ModeSymlink != 0) {
|
||||
return false, fmt.Errorf("unsafe run cleanup directory %q", runsDir)
|
||||
}
|
||||
viewsExist, err := fileops.InspectManagedAttemptViews(session, cleanupManagedNames())
|
||||
viewsExist, err := artifacts.InspectManagedAttemptViews(session, cleanupManagedNames())
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user