Skip to content

Commit

Permalink
snc.sh: use oc adm prune renderedmachineconfigs to remove older mac…
Browse files Browse the repository at this point in the history
…hine configs
  • Loading branch information
redbeam authored and praveenkumar committed Jun 21, 2024
1 parent 0d4dfbf commit 121edf2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions snc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,7 @@ wait_till_cluster_stable openshift-marketplace
retry ${OC} delete pod --field-selector=status.phase==Succeeded --all-namespaces

# Delete outdated rendered master/worker machineconfigs and just keep the latest one
mc_name=$(retry ${OC} get mc --sort-by=.metadata.creationTimestamp --no-headers -oname)
echo "${mc_name}" | grep rendered-master | head -n -1 | xargs -t ${OC} delete
echo "${mc_name}" | grep rendered-worker | head -n -1 | xargs -t ${OC} delete
${OC} adm prune renderedmachineconfigs --confirm
# Wait till machine config pool is updated correctly
while retry ${OC} get mcp master -ojsonpath='{.status.conditions[?(@.type!="Updated")].status}' | grep True; do
echo "Machine config still in updating/degrading state"
Expand Down

0 comments on commit 121edf2

Please sign in to comment.