Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12141

How do I fix the error rm: can't remove '/workspace/source': Resource busy?

$
0
0

I am currently working on a project for one of my courses and right now as part of one of the tasks they're having us set up a pipeline on OpenShift and add tasks. The first task I am trying to add is the cleanup task which was already created in the terminal. When I tried to add the task to the newly created pipeline I get an rm: can't remove '/workspace/source': Resource busy error. What does that mean and how do I fix this error? This is what my code for the cleanup task looks in the file;


apiVersion: tekton.dev/v1beta1kind: Taskmetadata:name: cleanupspec:description: This task will clean up a workspace by deleting all the filesworkspaces:- name: sourcesteps:- name: removeimage: alpine:3env:- name: WORKSPACE_SOURCE_PATHvalue: $(workspaces.source.path)workingDir: $(workspaces.source.path)securityContext:runAsNonRoot: falserunAsUser: 0script: |set -euecho "Removing all files from ${WORKSPACE_SOURCE_PATH} ..."

    if [ -d "${WORKSPACE_SOURCE_PATH}" ] ; then      rm -rf "${WORKSPACE_SOURCE_PATH:?}"    fi

apiVersion: tekton.dev/v1beta1kind: Taskmetadata:name: nosespec:workspaces:- name: sourceparams:- name: argsdescription: Arguments to pass to nosetype: stringdefault: "-v"steps:- name: nosetestsimage: python:3.9-slimworkingDir: $(workspaces.source.path)script: |set -epython -m pip install --upgrade pip wheelpip install -r requirements.txtnosetests $(params.args)

I dont know how to resolve this problem so I need someone's help regarding this issue and how to resolve it


Viewing all articles
Browse latest Browse all 12141

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>