Skip to content

Commit

Permalink
fingerprint gce: collect preemptibility
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigol-chan authored and Juanadelacuesta committed Oct 24, 2024
1 parent d44a2f9 commit b6fc73c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/24169.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
fingerprint gce: fingerprint preemptibility
```
1 change: 1 addition & 0 deletions client/fingerprint/env_gce.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions client/fingerprint/env_gce_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit b6fc73c

Please sign in to comment.