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

Review changes from scripts-dev to scripts-adopter #1377

Merged
merged 1 commit into from
Jul 20, 2023
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
14 changes: 7 additions & 7 deletions cp3pt0-deployment/common/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,14 @@ function wait_for_operator() {

function wait_for_csv() {
local namespace=$1
local operator_name=$2
local condition="${OC} -n ${namespace} get csv --no-headers --ignore-not-found | grep ^${operator_name}"
local package_name=$2
local condition="${OC} get subscription.operators.coreos.com -l operators.coreos.com/${package_name}.${namespace}='' -n ${namespace} -o yaml -o jsonpath='{.items[*].status.installedCSV}' | grep ^${package_name}"
local retries=30
local sleep_time=10
local total_time_mins=$(( sleep_time * retries / 60))
local wait_message="Waiting for operator ${operator_name} CSV in namespace ${namespace} to be generated"
local success_message="Operator ${operator_name} CSV in namespace ${namespace} is generated"
local error_message="Timeout after ${total_time_mins} minutes waiting for ${operator_name} CSV in namespace ${namespace} to be generated"
local wait_message="Waiting for operator ${package_name} CSV in namespace ${namespace} to be generated"
local success_message="Operator ${package_name} CSV in namespace ${namespace} is generated"
local error_message="Timeout after ${total_time_mins} minutes waiting for ${package_name} CSV in namespace ${namespace} to be generated"

wait_for_condition "${condition}" ${retries} ${sleep_time} "${wait_message}" "${success_message}" "${error_message}"
}
Expand Down Expand Up @@ -297,8 +297,8 @@ function wait_for_nss_patch() {
if [[ ( ${retries} -eq 0 ) && ( -z "${result}" ) ]]; then
warning "Deleting pod ${pod_name} in namespace ${namespace} to trigger NamespaceScope reconciliaiton"
$OC delete pod ${pod_name} -n ${namespace}
# reset retries to 6 times to wait one minute
retries=6
# reset retries to 30 times to wait 5 minutes
retries=30
wait_for_condition "${condition}" ${retries} ${sleep_time} "${wait_message}" "${success_message}" "${error_message}"
break
fi
Expand Down
Loading