mirror of
https://github.com/floci-io/floci.git
synced 2026-12-03 02:07:58 -05:00
fix(compat): install AWS CLI v2 in the compat image so AWS_ENDPOINT_URL is honored (#2315)
* fix(compat): shim aws to inject --endpoint-url from AWS_ENDPOINT_URL, add CI smoke test * fix(compat): migrate to AWS CLI v2, drop the endpoint-url shim --------- Co-authored-by: doraemon2200 <106516578+doraemon2200@users.noreply.github.com>
This commit is contained in:
1 parent
c194bffe30
commit
9fda5f5919
2 files changed
+92
-3
No files matched your search
@@ -6,6 +6,7 @@ on:
|
||||
- 'src/**'
|
||||
- 'pom.xml'
|
||||
- 'docker/Dockerfile.native-package'
|
||||
- 'docker/Dockerfile.compat'
|
||||
- 'docker/entrypoint.sh'
|
||||
- 'docker/localstack-parity.sh'
|
||||
- 'compatibility-tests/**'
|
||||
@@ -19,6 +20,66 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
compat-aws-cli-shim:
|
||||
name: compat / aws CLI endpoint resolution
|
||||
runs-on: ubuntu-24.04-arm
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
|
||||
|
||||
- name: Build compat image
|
||||
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
|
||||
with:
|
||||
context: .
|
||||
file: docker/Dockerfile.compat
|
||||
build-args: VERSION=latest
|
||||
load: true
|
||||
tags: floci-compat-shim-test
|
||||
cache-from: type=gha,scope=compat-shim
|
||||
cache-to: type=gha,scope=compat-shim,mode=max
|
||||
|
||||
- name: Unflagged aws sqs call routes to AWS_ENDPOINT_URL
|
||||
run: |
|
||||
out=$(docker run --rm --entrypoint sh floci-compat-shim-test -c \
|
||||
"aws sqs create-queue --queue-name smoke-test 2>&1" || true)
|
||||
echo "$out"
|
||||
echo "$out" | grep -q "localhost:4566" \
|
||||
|| { echo "::error::unflagged aws call did not target localhost:4566"; exit 1; }
|
||||
echo "$out" | grep -qi "queue.amazonaws.com\|InvalidClientTokenId" \
|
||||
&& { echo "::error::unflagged aws call reached real AWS endpoint"; exit 1; }
|
||||
exit 0
|
||||
|
||||
- name: AWS_ENDPOINT_URL_SQS alone routes correctly
|
||||
run: |
|
||||
out=$(docker run --rm --entrypoint sh -e AWS_ENDPOINT_URL= \
|
||||
-e AWS_ENDPOINT_URL_SQS=http://localhost:4566 \
|
||||
floci-compat-shim-test -c \
|
||||
"aws sqs create-queue --queue-name smoke-test-service-override 2>&1" || true)
|
||||
echo "$out"
|
||||
echo "$out" | grep -q "localhost:4566" \
|
||||
|| { echo "::error::AWS_ENDPOINT_URL_SQS was not honored"; exit 1; }
|
||||
echo "$out" | grep -qi "queue.amazonaws.com\|InvalidClientTokenId" \
|
||||
&& { echo "::error::AWS_ENDPOINT_URL_SQS call reached real AWS endpoint"; exit 1; }
|
||||
exit 0
|
||||
|
||||
- name: Explicit --endpoint-url before the subcommand overrides AWS_ENDPOINT_URL
|
||||
run: |
|
||||
out=$(docker run --rm --entrypoint sh floci-compat-shim-test -c \
|
||||
"AWS_ENDPOINT_URL=http://example.com aws --endpoint-url http://other.example.com sqs list-queues 2>&1" || true)
|
||||
echo "$out"
|
||||
echo "$out" | grep -q "other.example.com" \
|
||||
|| { echo "::error::pre-subcommand --endpoint-url flag was not honored over AWS_ENDPOINT_URL"; exit 1; }
|
||||
|
||||
- name: Explicit --endpoint-url after the subcommand overrides AWS_ENDPOINT_URL
|
||||
run: |
|
||||
out=$(docker run --rm --entrypoint sh floci-compat-shim-test -c \
|
||||
"AWS_ENDPOINT_URL=http://example.com aws sqs list-queues --endpoint-url http://other.example.com 2>&1" || true)
|
||||
echo "$out"
|
||||
echo "$out" | grep -q "other.example.com" \
|
||||
|| { echo "::error::post-subcommand --endpoint-url flag was not honored over AWS_ENDPOINT_URL"; exit 1; }
|
||||
|
||||
build-native:
|
||||
name: Build native floci image
|
||||
runs-on: ubuntu-24.04-arm
|
||||
|
||||
Reference in new issue
Block a user