-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix context timeout associated with imds apis #1732
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
source /helpers.sh | ||
|
||
wait::dbus-ready | ||
mock::kubelet 1.29.0 | ||
|
||
# configure without launching the imds mock service | ||
IMDS_MOCK_ONLY_CONFIGURE=true mock::aws | ||
|
||
if nodeadm init --skip run; then | ||
echo "bootstrap should not succeed when EC2 IMDS APIs are not reachable." | ||
exit 1 | ||
fi | ||
|
||
# start the imds mock part way into the initialization to mimic | ||
# delayed availability of IMDS | ||
{ sleep 10 && AWS_MOCK_ONLY_CONFIGURE=true mock::aws; } & | ||
nodeadm init --skip run |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,9 +102,9 @@ function wait::dbus-ready() { | |
|
||
function mock::aws() { | ||
local CONFIG_PATH=${1:-/etc/aemm-default-config.json} | ||
imds-mock --config-file $CONFIG_PATH & | ||
[ "${IMDS_MOCK_ONLY_CONFIGURE:-}" = "true" ] || imds-mock --config-file $CONFIG_PATH & | ||
export AWS_EC2_METADATA_SERVICE_ENDPOINT=http://localhost:1338 | ||
$HOME/.local/bin/moto_server -p5000 & | ||
[ "${AWS_MOCK_ONLY_CONFIGURE:-}" = "true" ] || $HOME/.local/bin/moto_server -p5000 & | ||
Comment on lines
-105
to
+107
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe just split this into 2 helpers, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i was considering it, and I would probably still use an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there's not much pressure since this is a pretty unique test so lets not worry about it for now :) |
||
export AWS_ACCESS_KEY_ID='testing' | ||
export AWS_SECRET_ACCESS_KEY='testing' | ||
export AWS_SECURITY_TOKEN='testing' | ||
|
@@ -114,12 +114,3 @@ function mock::aws() { | |
# ensure that our instance exists in the API | ||
aws ec2 run-instances | ||
} | ||
|
||
function mock::instance-type() { | ||
cat /etc/aemm-default-config.json | jq '.metadata.values."instance-type" = "mock-type.large" | .dynamic.values."instance-identity-document".instanceType = "mock-type.large"' | tee /etc/aemm-default-config.json | ||
} | ||
|
||
function revert::mock::instance-type() { | ||
cat /etc/aemm-default-config.json | jq '.metadata.values."instance-type" = "m4.xlarge" | .dynamic.values."instance-identity-document".instanceType = "m4.xlarge"' | tee /etc/aemm-default-config.json | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this means 1 second between each attempt, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, the underlying exponential retryer just behaves linearly for 1 second backoff