Skip to content

Commit

Permalink
Merge pull request #66 from detiber/add-local-hostname
Browse files Browse the repository at this point in the history
Add local-hostname to metadata
  • Loading branch information
jacobweinstock authored Sep 21, 2021
2 parents 2b42541 + 6c0ade5 commit 89cb9dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion http-server/http_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ var (
ec2Filters = map[string]string{
"": `"meta-data", "user-data"`, // base path
"/user-data": ".metadata.userdata",
"/meta-data": `["instance-id", "hostname", "iqn", "plan", "facility", "tags", "operating-system", "public-keys", "public-ipv4", "public-ipv6", "local-ipv4"] + (if .metadata.instance.spot != null then ["spot"] else [] end) | sort | .[]`,
"/meta-data": `["instance-id", "hostname", "local-hostname", "iqn", "plan", "facility", "tags", "operating-system", "public-keys", "public-ipv4", "public-ipv6", "local-ipv4"] + (if .metadata.instance.spot != null then ["spot"] else [] end) | sort | .[]`,
"/meta-data/instance-id": ".metadata.instance.id",
"/meta-data/hostname": ".metadata.instance.hostname",
"/meta-data/local-hostname": ".metadata.instance.hostname",
"/meta-data/iqn": ".metadata.instance.iqn",
"/meta-data/plan": ".metadata.instance.plan",
"/meta-data/facility": ".metadata.instance.facility",
Expand Down
3 changes: 3 additions & 0 deletions http-server/http_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ echo "Hello world!"`,
hostname
instance-id
iqn
local-hostname
local-ipv4
operating-system
plan
Expand Down Expand Up @@ -747,6 +748,7 @@ user-data`,
hostname
instance-id
iqn
local-hostname
local-ipv4
operating-system
plan
Expand Down Expand Up @@ -809,6 +811,7 @@ version`,
hostname
instance-id
iqn
local-hostname
local-ipv4
operating-system
plan
Expand Down

0 comments on commit 89cb9dc

Please sign in to comment.