Skip to content

Commit aaa6118

Browse files
willmyrsJoseVillalta
authored andcommitted
fix: accept splunk terms
1 parent 1cc9f77 commit aaa6118

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,42 @@ jobs:
152152
SPLUNK_PORT=8089
153153
SPLUNK_IMAGE=splunk/splunk
154154
CONTAINER_ID=$(docker run -d -p $SPLUNK_PORT:8089 -p 8088:8088 \
155+
-e "SPLUNK_GENERAL_TERMS=--accept-sgt-current-at-splunk-com" \
155156
-e "SPLUNK_START_ARGS=--accept-license" \
156157
-e "SPLUNK_PASSWORD=$SPLUNK_PASSWORD" \
157158
-e "SPLUNK_HEC_TOKEN=abcd1234" \
158159
$SPLUNK_IMAGE)
159160
161+
echo "Splunk container ID: $CONTAINER_ID"
162+
160163
: # Splunk can only receives requests after becoming healthy
161-
until [ $(docker inspect $CONTAINER_ID --format ‘{{.State.Health.Status}}’) == ‘healthy’ ]; do sleep 10s; done;
164+
: # Wait up to 5 minutes for the container to become healthy
165+
TIMEOUT=300
166+
ELAPSED=0
167+
INTERVAL=10
168+
169+
while [ $ELAPSED -lt $TIMEOUT ]; do
170+
HEALTH_STATUS=$(docker inspect $CONTAINER_ID --format '{{.State.Health.Status}}')
171+
echo "Health status after ${ELAPSED}s: $HEALTH_STATUS"
172+
173+
if [ "$HEALTH_STATUS" == "healthy" ]; then
174+
echo "Splunk container is healthy"
175+
break
176+
fi
177+
178+
sleep $INTERVAL
179+
ELAPSED=$((ELAPSED + INTERVAL))
180+
done
181+
182+
: # Check if we timed out
183+
if [ $ELAPSED -ge $TIMEOUT ]; then
184+
echo "ERROR: Splunk container failed to become healthy within ${TIMEOUT} seconds"
185+
echo "Container logs:"
186+
docker logs $CONTAINER_ID
187+
echo "Container inspect:"
188+
docker inspect $CONTAINER_ID
189+
exit 1
190+
fi
162191
163192
curl -L -k -u admin:$SPLUNK_PASSWORD \
164193
-X POST https://localhost:$SPLUNK_PORT/services/admin/token-auth/tokens_auth \

0 commit comments

Comments
 (0)