mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
fingerprint gce: collect preemptibility
This commit is contained in:
3
.changelog/24169.txt
Normal file
3
.changelog/24169.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:improvement
|
||||
fingerprint gce: fingerprint preemptibility
|
||||
```
|
||||
@@ -160,6 +160,7 @@ func (f *EnvGCEFingerprint) Fingerprint(req *FingerprintRequest, resp *Fingerpri
|
||||
"cpu-platform": false,
|
||||
"scheduling/automatic-restart": false,
|
||||
"scheduling/on-host-maintenance": false,
|
||||
"scheduling/preemptible": false,
|
||||
}
|
||||
|
||||
for k, unique := range keys {
|
||||
|
||||
@@ -148,6 +148,7 @@ func testFingerprint_GCE(t *testing.T, withExternalIp bool) {
|
||||
|
||||
assertNodeAttributeEquals(t, response.Attributes, "platform.gce.scheduling.automatic-restart", "TRUE")
|
||||
assertNodeAttributeEquals(t, response.Attributes, "platform.gce.scheduling.on-host-maintenance", "MIGRATE")
|
||||
assertNodeAttributeEquals(t, response.Attributes, "platform.gce.scheduling.preemptible", "FALSE")
|
||||
assertNodeAttributeEquals(t, response.Attributes, "platform.gce.cpu-platform", "Intel Ivy Bridge")
|
||||
assertNodeAttributeEquals(t, response.Attributes, "platform.gce.tag.abc", "true")
|
||||
assertNodeAttributeEquals(t, response.Attributes, "platform.gce.tag.def", "true")
|
||||
@@ -200,6 +201,11 @@ const GCE_routes = `
|
||||
"content-type": "text/plain",
|
||||
"body": "MIGRATE"
|
||||
},
|
||||
{
|
||||
"uri": "/computeMetadata/v1/instance/scheduling/preemptible",
|
||||
"content-type": "text/plain",
|
||||
"body": "FALSE"
|
||||
},
|
||||
{
|
||||
"uri": "/computeMetadata/v1/instance/cpu-platform",
|
||||
"content-type": "text/plain",
|
||||
|
||||
Reference in New Issue
Block a user