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

Getting machineset using additional label flag to ignore 'infra' nodes. #147

Merged
merged 2 commits into from
May 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ pipeline {
echo -e "\033[1m$(date "+%d-%m-%YT%H:%M:%S") ${@}\033[0m"
}
function scaleMachineSets(){
scale_num=$(oc get --no-headers machinesets -A | awk '{print $2}' | wc -l | xargs)
scale_num=$(oc get --no-headers machinesets -A -l machine.openshift.io/cluster-api-machine-role!=infra,machine.openshift.io/cluster-api-machine-role!=workload | awk '{print $2}' | wc -l | xargs)
scale_size=$(($1/$scale_num))
set -x
for machineset in $(oc get --no-headers machinesets -A | awk '{print $2}'); do
for machineset in $(oc get --no-headers machinesets -A -l machine.openshift.io/cluster-api-machine-role!=infra,machine.openshift.io/cluster-api-machine-role!=workload | awk '{print $2}'); do
oc scale machinesets -n openshift-machine-api $machineset --replicas $scale_size
done
if [[ $(($1%$scale_num)) != 0 ]]; then
oc scale machinesets -n openshift-machine-api $(oc get --no-headers machinesets -A | awk '{print $2}' | head -1) --replicas $(($scale_size+$(($1%$scale_num))))
oc scale machinesets -n openshift-machine-api $(oc get --no-headers machinesets -A -l machine.openshift.io/cluster-api-machine-role!=infra,machine.openshift.io/cluster-api-machine-role!=workload | awk '{print $2}' | head -1) --replicas $(($scale_size+$(($1%$scale_num))))
fi
set +x
local retries=0
Expand Down