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 committed Oct 11, 2024
1 parent 13e1a72 commit 8151f88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
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 8151f88

Please sign in to comment.