mirror of
https://github.com/kemko/nomad.git
synced 2026-01-03 08:55:43 +03:00
* func: add dependencies to avoid race conditions and move the update to each client to the main upgrade scenario * Update enos/enos-scenario-upgrade.hcl Co-authored-by: Tim Gross <tgross@hashicorp.com> * Update enos/enos-scenario-upgrade.hcl Co-authored-by: Tim Gross <tgross@hashicorp.com> --------- Co-authored-by: Tim Gross <tgross@hashicorp.com>
19 lines
520 B
Bash
Executable File
19 lines
520 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Copyright (c) HashiCorp, Inc.
|
|
# SPDX-License-Identifier: BUSL-1.1
|
|
|
|
set -euo pipefail
|
|
|
|
if ! client_id=$(nomad node status -address "https://$CLIENT_IP:4646" -self -json | jq '.ID' | tr -d '"'); then
|
|
echo "No client found at $CLIENT_IP"
|
|
exit 1
|
|
fi
|
|
|
|
if ! nomad node meta apply \
|
|
-node-id "$client_id" node_ip="$CLIENT_IP" nomad_addr="$NOMAD_ADDR"; then
|
|
echo "Failed to set metadata for node: $client_id at $CLIENT_IP"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Metadata updated in $client_id at $CLIENT_IP"
|