Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes 4775: add weekly cron for pulp orphan cleanup #877

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rverdile
Copy link
Contributor

@rverdile rverdile commented Nov 6, 2024

Summary

Adds a new command and weekly cron job to run orphan cleanup for pulp. Runs in batches of 5 orgs.

Testing steps

  1. You can use this script to create a bunch of orgs
TOTAL_ORGS=33

for ((i=0; i<$TOTAL_ORGS; ++i))
do

ORG_ID=`tr -dc A-Za-z0-9 </dev/urandom | head -c 13`

HEADER=`./scripts/header.sh $ORG_ID`

UUID=$(curl -X POST --location "http://localhost:8000/api/content-sources/v1.0/repositories/" \
    -H "${HEADER}" \
    -H "Content-Type: application/json" \
    -d '{
          "name": "comps repo 2",
          "url": "https://rverdile.fedorapeople.org/dummy-repos/comps/repo2/",
          "snapshot": true
  }' | jq -r .uuid)

curl -X DELETE --location "http://localhost:8000/api/content-sources/v1.0/repositories/$UUID" \
    -H "${HEADER}" \
    -H "Content-Type: application/json"
done
  1. Run go cmd/external-repos/main.go pulp-orphan-cleanup
  2. In the logs you'll see the pulp tasks running in groups of 5

@jlsherrill
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants