generated from ministryofjustice/hmpps-template-kotlin
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2842 from ministryofjustice/chore/improve-seed-jo…
…b-log-instructions Improve seed job log checking instructions
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
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
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,23 @@ | ||
|
||
if [ -z "$1" ] || ! [[ "$1" =~ ^(dev|test|preprod|prod)$ ]]; then | ||
echo "Usage:" | ||
echo "pod_logs dev|test|preprod|prod [pod_name]" | ||
echo "" | ||
echo "If no pod name is defined, the first API pod found will be used" | ||
exit 1 | ||
else | ||
environment=$1 | ||
fi | ||
|
||
namespace="hmpps-community-accommodation-$environment" | ||
|
||
if [ -z "$2" ]; then | ||
echo "No pod specified, will use first API pod found" | ||
pod=$(kubectl -n "$namespace" get pods -l app=hmpps-approved-premises-api -o jsonpath='{.items[0].metadata.name}') | ||
else | ||
pod="$2" | ||
fi | ||
|
||
echo "Outputting logs for $pod" | ||
|
||
kubectl -n $namespace logs "$pod" |