mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
client: Add AWS EC2 instance-life-cycle from metadata to client fingerprint (#12371)
This commit is contained in:
3
.changelog/12371.txt
Normal file
3
.changelog/12371.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:improvement
|
||||
client: fingerprint AWS instance life cycle option
|
||||
```
|
||||
@@ -91,6 +91,7 @@ func (f *EnvAWSFingerprint) Fingerprint(request *FingerprintRequest, response *F
|
||||
"ami-id": false,
|
||||
"hostname": true,
|
||||
"instance-id": true,
|
||||
"instance-life-cycle": false,
|
||||
"instance-type": false,
|
||||
"local-hostname": true,
|
||||
"local-ipv4": true,
|
||||
|
||||
@@ -52,6 +52,7 @@ func TestEnvAWSFingerprint_aws(t *testing.T) {
|
||||
"platform.aws.ami-id",
|
||||
"unique.platform.aws.hostname",
|
||||
"unique.platform.aws.instance-id",
|
||||
"platform.aws.instance-life-cycle",
|
||||
"platform.aws.instance-type",
|
||||
"unique.platform.aws.local-hostname",
|
||||
"unique.platform.aws.local-ipv4",
|
||||
@@ -334,6 +335,11 @@ var awsStubs = []endpoint{
|
||||
ContentType: "text/plain",
|
||||
Body: "i-b3ba3875",
|
||||
},
|
||||
{
|
||||
Uri: "/latest/meta-data/instance-life-cycle",
|
||||
ContentType: "text/plain",
|
||||
Body: "on-demand",
|
||||
},
|
||||
{
|
||||
Uri: "/latest/meta-data/instance-type",
|
||||
ContentType: "text/plain",
|
||||
@@ -387,6 +393,11 @@ var unknownInstanceType = []endpoint{
|
||||
ContentType: "text/plain",
|
||||
Body: "i-b3ba3875",
|
||||
},
|
||||
{
|
||||
Uri: "/latest/meta-data/instance-life-cycle",
|
||||
ContentType: "text/plain",
|
||||
Body: "on-demand",
|
||||
},
|
||||
{
|
||||
Uri: "/latest/meta-data/instance-type",
|
||||
ContentType: "text/plain",
|
||||
@@ -417,6 +428,11 @@ var noNetworkAWSStubs = []endpoint{
|
||||
ContentType: "text/plain",
|
||||
Body: "i-b3ba3875",
|
||||
},
|
||||
{
|
||||
Uri: "/latest/meta-data/instance-life-cycle",
|
||||
ContentType: "text/plain",
|
||||
Body: "on-demand",
|
||||
},
|
||||
{
|
||||
Uri: "/latest/meta-data/instance-type",
|
||||
ContentType: "text/plain",
|
||||
|
||||
@@ -235,6 +235,12 @@ Below is a table documenting common node properties:
|
||||
</td>
|
||||
<td>AMI ID of the client (if on AWS EC2)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>{'${attr.platform.aws.instance-life-cycle}'}</code>
|
||||
</td>
|
||||
<td>Instance lifecycle (e.g. spot, on-demand) of the client (if on AWS EC2)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>{'${attr.platform.aws.instance-type}'}</code>
|
||||
|
||||
Reference in New Issue
Block a user