SSH metadata doesn't match the IMDS format
Describe the bug
The mock server returns SSH keys in a different format than EC2 IMDS.
e.g.
http://169.254.169.254/latest/meta-data/public-keys/
returns
0=mykey
on EC2 whilst this project returns
0/
Which means that the ec2-metadata tool that ships with Amazon Linux 2 chokes on the output:
ec2-metadata --public-keys
garblles output:
$ ec2-metadata --public-keys
public-keys:
keyname:0/
index:0/
format:public-keys/
key:(begins from next line)
Steps to reproduce
$ sudo ip addr add 169.254.169.254 dev enp0s1
$ sudo ec2-metadata-mock --hostname 169.254.169.254 --port 80
$ ec2-metadata --public-keys
public-keys:
keyname:0/
index:0/
format:public-keys/
key:(begins from next line)
Expected outcome
$ ec2-metadata --public-keys
public-keys:
keyname:framework
index:0
format:openssh-key
key:(begins from next line)
ssh-ed25519 XXXXXXXX framework
Application Logs The log output when experiencing the issue.
Environment
- AEMM Version: v1.12.0
- OS/Arch: Amazon Linux 2
- Installation method:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want this issue to never become stale, please ask a maintainer to apply the "stalebot-ignore" label.
Not stale. Can somebody at least react on an issue before stale-botting it?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want this issue to never become stale, please ask a maintainer to apply the "stalebot-ignore" label.
Still not stale. Can anybody react?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want this issue to never become stale, please ask a maintainer to apply the "stalebot-ignore" label.
Please apply the "stalebot-ignore" label