-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add kubernetes check state script
Signed-off-by: sebastien.heurtematte <[email protected]>
- Loading branch information
1 parent
9f03b70
commit 789e8fc
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
#******************************************************************************* | ||
# Copyright (c) 2019 Eclipse Foundation and others. | ||
# This program and the accompanying materials are made available | ||
# under the terms of the Eclipse Public License 2.0 | ||
# which is available at http://www.eclipse.org/legal/epl-v20.html, | ||
# or the MIT License which is available at https://opensource.org/licenses/MIT. | ||
# SPDX-License-Identifier: EPL-2.0 OR MIT | ||
#******************************************************************************* | ||
|
||
# Bash strict-mode | ||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
IFS=$'\n\t' | ||
|
||
# Usage: ./check_state.sh ../instances/foundation-internal.* | ||
|
||
if [[ "${#}" -eq 0 ]]; then | ||
echo "ERROR: you must provide at least one 'instance' path" | ||
exit 1 | ||
fi | ||
|
||
for instance in "${@}"; do | ||
project_name="$(basename "${instance}")" | ||
short_name="${project_name##*.}" | ||
url="$(jq -r '.deployment.url' "${instance}/target/config.json")" | ||
echo "${project_name} ${url} $(kubectl get pod "${short_name}"-0 -n "${short_name}" --no-headers -o custom-columns=":status.phase")" | ||
done | column -t |