Skip to content

Commit c79a94e

Browse files
authored
Guides: add mandatory curl --fail option (#3610)
`curl` does _not_ return an error code when the URL can be retrieved but returns an error HTTP status code, for example 404, 403, 401. This means that the health checks are yieldíng "OK" too early. This change adds the missing `--fail` option.
1 parent 618d489 commit c79a94e

11 files changed

Lines changed: 25 additions & 18 deletions

File tree

getting-started/assets/polaris/create-catalog.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ PAYLOAD='{
7777

7878
echo $PAYLOAD
7979

80-
curl -s -H "Authorization: Bearer ${TOKEN}" \
80+
curl --fail-with-body \
81+
-s \
82+
-H "Authorization: Bearer ${TOKEN}" \
8183
-H 'Accept: application/json' \
8284
-H 'Content-Type: application/json' \
8385
-H "Polaris-Realm: $realm" \

getting-started/assets/polaris/obtain-token.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ apk add --no-cache jq
2323

2424
realm=${1:-"POLARIS"}
2525

26-
TOKEN=$(curl -s http://polaris:8181/api/catalog/v1/oauth/tokens \
26+
TOKEN=$(curl \
27+
--fail-with-body \
28+
-s \
29+
http://polaris:8181/api/catalog/v1/oauth/tokens \
2730
--user ${CLIENT_ID}:${CLIENT_SECRET} \
2831
-H "Polaris-Realm: $realm" \
2932
-d grant_type=client_credentials \

getting-started/ceph/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ services:
127127
depends_on:
128128
- osd1
129129
healthcheck:
130-
test: ["CMD", "curl", "-f", "http://localhost:7480"]
130+
test: ["CMD", "curl", "--fail", "http://localhost:7480"]
131131
interval: 2s
132132
timeout: 10s
133133
retries: 10
@@ -172,7 +172,7 @@ services:
172172
polaris.realm-context.realms: POLARIS
173173
quarkus.otel.sdk.disabled: "true"
174174
healthcheck:
175-
test: ["CMD", "curl", "http://localhost:8182/q/health"]
175+
test: ["CMD", "curl", "--fail", "http://localhost:8182/q/health"]
176176
interval: 2s
177177
timeout: 10s
178178
retries: 10

getting-started/jdbc/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ services:
4545
polaris.features."SUPPORTED_CATALOG_STORAGE_TYPES": "[\"FILE\",\"S3\",\"GCS\",\"AZURE\"]"
4646
polaris.readiness.ignore-severe-issues: "true"
4747
healthcheck:
48-
test: ["CMD", "curl", "http://localhost:8182/q/health"]
48+
test: ["CMD", "curl", "--fail", "http://localhost:8182/q/health"]
4949
interval: 2s
5050
timeout: 10s
5151
retries: 10
@@ -76,7 +76,7 @@ services:
7676
ports:
7777
- "4040-4045:4040-4045"
7878
healthcheck:
79-
test: "curl localhost:4040"
79+
test: ["CMD", "curl", "--fail", "http://localhost:4040"]
8080
interval: 5s
8181
retries: 15
8282
command: [

getting-started/keycloak/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ services:
5151
polaris.features."SUPPORTED_CATALOG_STORAGE_TYPES": "[\"FILE\",\"S3\",\"GCS\",\"AZURE\"]"
5252
polaris.readiness.ignore-severe-issues: "true"
5353
healthcheck:
54-
test: ["CMD", "curl", "http://localhost:8182/q/health"]
54+
test: ["CMD", "curl", "--fail", "http://localhost:8182/q/health"]
5555
interval: 2s
5656
timeout: 10s
5757
retries: 10

getting-started/minio/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ services:
3535
- "--console-address"
3636
- ":9001"
3737
healthcheck:
38-
test: ["CMD", "curl", "http://127.0.0.1:9000/minio/health/live"]
38+
test: ["CMD", "curl", "--fail", "http://127.0.0.1:9000/minio/health/live"]
3939
interval: 1s
4040
timeout: 10s
4141

@@ -61,7 +61,7 @@ services:
6161
polaris.realm-context.realms: POLARIS
6262
quarkus.otel.sdk.disabled: "true"
6363
healthcheck:
64-
test: ["CMD", "curl", "http://localhost:8182/q/health"]
64+
test: ["CMD", "curl", "--fail", "http://localhost:8182/q/health"]
6565
interval: 2s
6666
timeout: 10s
6767
retries: 10

getting-started/ozone/docker-compose.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ services:
7272
ozone-datanode:
7373
condition: service_started
7474
healthcheck:
75-
test: ["CMD", "curl", "http://localhost:9888"]
75+
test: ["CMD", "curl", "--fail", "http://localhost:9888"]
7676
interval: 1s
7777
timeout: 10s
7878
retries: 60
@@ -91,7 +91,9 @@ services:
9191
<<: *ozone-common-config
9292
WAITFOR: ozone-om:9874
9393
healthcheck:
94-
test: ["CMD", "curl", "http://localhost:9878"]
94+
test: ["CMD", "curl", "--fail", "http://localhost:19878"]
95+
# Should ideally use the following, but the curl version in ozone image is too old (7.76.1) to support --aws-sigv4
96+
# test: ["CMD", "curl", "--fail", "--user", "root:s3cr3t", "--aws-sigv4", "aws:amz:us-west-1:s3", "http://localhost:9878"]
9597
interval: 1s
9698
timeout: 10s
9799
retries: 60
@@ -118,7 +120,7 @@ services:
118120
polaris.realm-context.realms: POLARIS
119121
quarkus.otel.sdk.disabled: "true"
120122
healthcheck:
121-
test: ["CMD", "curl", "http://localhost:8182/q/health"]
123+
test: ["CMD", "curl", "--fail", "http://localhost:8182/q/health"]
122124
interval: 2s
123125
timeout: 10s
124126
retries: 60

getting-started/quickstart/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ services:
3434
RUSTFS_CONSOLE_ENABLE: "true"
3535
RUSTFS_CONSOLE_ADDRESS: ":9001"
3636
healthcheck:
37-
test: ["CMD-SHELL", "curl -f http://127.0.0.1:9000/health && curl -f http://127.0.0.1:9001/rustfs/console/health"]
37+
test: ["CMD-SHELL", "curl --fail http://127.0.0.1:9000/health && curl --fail http://127.0.0.1:9001/rustfs/console/health"]
3838
interval: 30s
3939
timeout: 10s
4040
retries: 3
@@ -62,7 +62,7 @@ services:
6262
polaris.realm-context.realms: ${POLARIS_REALM:-POLARIS}
6363
quarkus.otel.sdk.disabled: "true"
6464
healthcheck:
65-
test: ["CMD", "curl", "http://localhost:8182/q/health"]
65+
test: ["CMD", "curl", "--fail", "http://localhost:8182/q/health"]
6666
interval: 2s
6767
timeout: 10s
6868
retries: 10

getting-started/rustfs/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ services:
3232
RUSTFS_CONSOLE_ENABLE: "true"
3333
RUSTFS_CONSOLE_ADDRESS: ":9001"
3434
healthcheck:
35-
test: ["CMD-SHELL", "curl -f http://127.0.0.1:9000/health && curl -f http://127.0.0.1:9001/rustfs/console/health"]
35+
test: ["CMD-SHELL", "curl --fail http://127.0.0.1:9000/health && curl --fail http://127.0.0.1:9001/rustfs/console/health"]
3636
interval: 30s
3737
timeout: 10s
3838
retries: 3
@@ -60,7 +60,7 @@ services:
6060
polaris.realm-context.realms: POLARIS
6161
quarkus.otel.sdk.disabled: "true"
6262
healthcheck:
63-
test: ["CMD-SHELL", "curl -f http://localhost:8182/q/health"]
63+
test: ["CMD", "curl", "--fail", "http://localhost:8182/q/health"]
6464
interval: 2s
6565
timeout: 10s
6666
retries: 10

getting-started/spark/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ services:
3434
polaris.features."SUPPORTED_CATALOG_STORAGE_TYPES": "[\"FILE\",\"S3\",\"GCS\",\"AZURE\"]"
3535
polaris.readiness.ignore-severe-issues: "true"
3636
healthcheck:
37-
test: ["CMD", "curl", "http://localhost:8182/healthcheck"]
37+
test: ["CMD", "curl", "--fail", "http://localhost:8182/q/health"]
3838
interval: 10s
3939
timeout: 10s
4040
retries: 5

0 commit comments

Comments
 (0)