Skip to content

Commit 07ec9c1

Browse files
committed
fix: verify-contents.sh
1 parent 62df1e9 commit 07ec9c1

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

.github/scripts/verify-contents.sh

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,6 @@ if [ ! -d "$EXTRACTED_DIR" ]; then
1616
exit 1
1717
fi
1818

19-
# Find the actual supportpkg directory (it should be nested)
20-
SUPPORTPKG_DIR=$(find "$EXTRACTED_DIR" -maxdepth 2 -type d -name "*supportpkg*" | head -n 1)
21-
22-
if [ -z "$SUPPORTPKG_DIR" ]; then
23-
echo "Error: Could not find supportpkg directory in extracted contents"
24-
echo "Available directories:"
25-
find "$EXTRACTED_DIR" -type d | head -20
26-
exit 1
27-
fi
28-
29-
echo "Found supportpkg directory: $SUPPORTPKG_DIR"
30-
3119
# List of expected files/directories based on the common and NIC job lists
3220
EXPECTED_ITEMS=(
3321
"manifest.json"
@@ -59,7 +47,7 @@ MISSING_ITEMS=()
5947
FOUND_ITEMS=()
6048

6149
for item in "${EXPECTED_ITEMS[@]}"; do
62-
FULL_PATH="$SUPPORTPKG_DIR/$item"
50+
FULL_PATH="$EXTRACTED_DIR/$item"
6351
if [ -e "$FULL_PATH" ]; then
6452
FOUND_ITEMS+=("$item")
6553
echo "✓ Found: $item"
@@ -71,7 +59,7 @@ done
7159

7260
# Check optional items
7361
for item in "${OPTIONAL_ITEMS[@]}"; do
74-
FULL_PATH="$SUPPORTPKG_DIR/$item"
62+
FULL_PATH="$EXTRACTED_DIR/$item"
7563
if [ -e "$FULL_PATH" ]; then
7664
echo "✓ Found optional: $item"
7765
else
@@ -80,7 +68,7 @@ for item in "${OPTIONAL_ITEMS[@]}"; do
8068
done
8169

8270
# Check if logs directory contains pod logs
83-
LOGS_DIR="$SUPPORTPKG_DIR/logs/nginx-ingress"
71+
LOGS_DIR="$EXTRACTED_DIR/logs/nginx-ingress"
8472
if [ -d "$LOGS_DIR" ]; then
8573
LOG_COUNT=$(find "$LOGS_DIR" -name "*.txt" | wc -l)
8674
if [ "$LOG_COUNT" -gt 0 ]; then
@@ -94,7 +82,7 @@ if [ -d "$LOGS_DIR" ]; then
9482
fi
9583

9684
# Check if manifest.json is valid JSON and contains expected fields
97-
MANIFEST_FILE="$SUPPORTPKG_DIR/manifest.json"
85+
MANIFEST_FILE="$EXTRACTED_DIR/manifest.json"
9886
if [ -f "$MANIFEST_FILE" ]; then
9987
if jq empty "$MANIFEST_FILE" 2>/dev/null; then
10088
echo "✓ manifest.json is valid JSON"
@@ -122,7 +110,7 @@ if [ -f "$MANIFEST_FILE" ]; then
122110
fi
123111

124112
# Check for kubernetes resource files content
125-
PODS_FILE="$SUPPORTPKG_DIR/resources/nginx-ingress/pods.json"
113+
PODS_FILE="$EXTRACTED_DIR/resources/nginx-ingress/pods.json"
126114
if [ -f "$PODS_FILE" ]; then
127115
if jq empty "$PODS_FILE" 2>/dev/null; then
128116
POD_COUNT=$(jq '.items | length' "$PODS_FILE" 2>/dev/null || echo "0")
@@ -143,7 +131,7 @@ if [ ${#MISSING_ITEMS[@]} -eq 0 ]; then
143131
echo "✅ All expected items found!"
144132
echo ""
145133
echo "Complete directory structure:"
146-
find "$SUPPORTPKG_DIR" -type f | sort | sed 's/^/ /'
134+
find "$EXTRACTED_DIR" -type f | sort | sed 's/^/ /'
147135
exit 0
148136
else
149137
echo "❌ Some expected items are missing:"
@@ -152,6 +140,6 @@ else
152140
done
153141
echo ""
154142
echo "Actual directory structure:"
155-
find "$SUPPORTPKG_DIR" -type f | sort | sed 's/^/ /'
143+
find "$EXTRACTED_DIR" -type f | sort | sed 's/^/ /'
156144
exit 1
157145
fi

0 commit comments

Comments
 (0)