Skip to content

Commit

Permalink
Reporting Init: Added wait between connectors configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Lalith Kota <[email protected]>
  • Loading branch information
lalithkota committed Aug 31, 2024
1 parent 7be8ed9 commit da50707
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions charts/reporting-init/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ startUpCommand: |-
debezium_connector_name=$(echo $debezium_connector_config | jq -cr '.name')
debezium_new_connectors_list+=("$debezium_connector_name")
debez_wait_secs=$(echo $debezium_connector_config | jq -cr '.wait_after_init_secs // empty')
debezium_connector_config=$(echo $debezium_connector_config | jq -cr 'del(.wait_after_init_secs)')
if_exists=$(contains "$debezium_existing_connectors_list" "$debezium_connector_name")
if [ -z "$if_exists" ]; then
echo "==> Creating new Connector - $debezium_connector_name."
Expand All @@ -219,6 +222,9 @@ startUpCommand: |-
echo "==> Connector - $debezium_connector_name - already exists. Updating config."
curl -s -XPUT -H 'Content-Type: application/json' $DEBEZIUM_URL/connectors/${debezium_connector_name}/config -d "$(echo $debezium_connector_config | jq -cr '.config')" | jq
fi
if [ -n "$debez_wait_secs" ]; then
sleep $debez_wait_secs
fi
done
echo "==> Starting deletion process for old debezium connectors."
debezium_new_connectors_list=${debezium_new_connectors_list[@]}
Expand All @@ -241,6 +247,9 @@ startUpCommand: |-
os_connector_name=$(echo $os_connector_config | jq -cr '.name')
os_new_connectors_list+=("$os_connector_name")
os_wait_secs=$(echo $os_connector_config | jq -cr '.wait_after_init_secs // empty')
os_connector_config=$(echo $os_connector_config | jq -cr 'del(.wait_after_init_secs)')
if_exists=$(contains "$os_existing_connectors_list" "$os_connector_name")
if [ -z "$if_exists" ]; then
echo "==> Creating new Connector - $os_connector_name."
Expand All @@ -249,6 +258,9 @@ startUpCommand: |-
echo "==> Connector - $os_connector_name - already exists. Updating config."
curl -s -XPUT -H 'Content-Type: application/json' $OS_KAFKA_CONNECTOR_URL/connectors/${os_connector_name}/config -d "$(echo $os_connector_config | jq -cr '.config')" | jq
fi
if [ -n "$os_wait_secs" ]; then
sleep $os_wait_secs
fi
done
echo "==> Starting deletion process for old opensearch-connectors."
os_new_connectors_list=${os_new_connectors_list[@]}
Expand Down

0 comments on commit da50707

Please sign in to comment.