Promote native Notarius lane products
This commit is contained in:
@@ -47,7 +47,13 @@ func (cleanupStage) Run(ctx context.Context, env *Env, m *manifest.Manifest) (*S
|
||||
if err := ctx.Err(); err != nil {
|
||||
return nil, fmt.Errorf("cleanup canceled before %s: %w", target.policy, err)
|
||||
}
|
||||
if err := fileops.RemoveAllUnderRoot(target.root, target.target); err != nil {
|
||||
var err error
|
||||
if target.policy == cleanupWorkspacePolicy {
|
||||
_, err = cleanRunWithRetainedBundle(target.root, target.target, true)
|
||||
} else {
|
||||
err = fileops.RemoveAllUnderRoot(target.root, target.target)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("apply %s: %w", target.policy, err)
|
||||
}
|
||||
completedPolicies = append(completedPolicies, target.policy)
|
||||
@@ -85,6 +91,16 @@ func (cleanupStage) ValidateResume(ctx context.Context, env *Env, m *manifest.Ma
|
||||
if err := ctx.Err(); err != nil {
|
||||
return ResumeValidation{}, fmt.Errorf("validate cleanup resume for %s: %w", target.policy, err)
|
||||
}
|
||||
if target.policy == cleanupWorkspacePolicy {
|
||||
pending, err := cleanRunWithRetainedBundle(target.root, target.target, false)
|
||||
if err != nil {
|
||||
return ResumeValidation{}, err
|
||||
}
|
||||
if pending {
|
||||
return NonResumable(fmt.Sprintf("cleanup target for %s exists", target.policy)), nil
|
||||
}
|
||||
continue
|
||||
}
|
||||
if _, err := os.Lstat(target.target); err == nil {
|
||||
return NonResumable(fmt.Sprintf("cleanup target for %s exists", target.policy)), nil
|
||||
} else if !errors.Is(err, os.ErrNotExist) {
|
||||
|
||||
Reference in New Issue
Block a user