-
Notifications
You must be signed in to change notification settings - Fork 28
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
aws_instance: fix broken user_data() #507
Conversation
user_data() is mistakenly unsupported IMDSv2, since it's not using __instance_metadata(). Fixed the code to use __instance_metadata(). Fixes scylladb#498
c61b740
to
d8cf7f4
Compare
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.
LGTM
@yaronkaikov The patch is already merged though, I have one thing don't understand. When I testing this patch with IMDSv2 mode userdata, I used example code of the userdata from our README.md.
(The script was for CentOS7 so I modified the command to apt-get, but anyway) But I realized that it causes "binascii.Error: Incorrect padding" exception while loading post_configuration_script. So it only accepts something like this:
Entire userdata will encode in base64 anyway (at least on EC2 I think), so post_configuration_script will encoded twice. But I actually found both SCT and testcase in scylla-machine-image expected post_configuration_script is encoded in base64. Do you know which way is correct? |
post_configuration_script should be base64 encoded it might be a nice extension feature to support also plain text, since now we are using yaml/json, but the base64 should still be working. |
user_data() is mistakenly unsupported IMDSv2, since it's not using __instance_metadata().
Fixed the code to use __instance_metadata().
Fixes #498