Skip to content

Fixed vera and GCP discrepancies for Zones, Regions, and Machine type#40

Open
raysunjello wants to merge 1 commit intoproject-vera:mainfrom
raysunjello:raymonds/GCPdebug
Open

Fixed vera and GCP discrepancies for Zones, Regions, and Machine type#40
raysunjello wants to merge 1 commit intoproject-vera:mainfrom
raysunjello:raymonds/GCPdebug

Conversation

@raysunjello
Copy link
Copy Markdown
Contributor

Summary

Fixes 7 fidelity issues found by comparing vera's GCP emulator responses to real GCP API responses across zones, regions, and machine types.

Issues Fixed

Issue 1 — Malformed selfLink URLs

zone.to_dict() and region.to_dict() were producing broken URLs like https://www.googleapis.com/compute/v1/us-central1-a (missing /projects/{project}/zones/ path segment). Fixed to use the correct full path.

Issue 2 — Missing creationTimestamp

Zones, regions, and machine types were missing creationTimestamp. Added the correct Unix epoch sentinel value 1969-12-31T16:00:00.000-08:00 that real GCP uses for resources with no meaningful creation time.

Issue 3 — Missing or non-deterministic IDs

Zone and region seeds had no id field. Machine type IDs were generated via hash() which changes every Python process run. Replaced with stable IDs verified against real GCP (e.g. us-central1-a → 2000, us-central1 → 1000, n1-standard-1 → 3001).

Issue 4 — deprecated field always included

zone.to_dict() and region.to_dict() always serialized deprecated: {} even for active resources. Real GCP omits this field entirely when a resource is not deprecated. Fixed to only include it when non-empty.

Issue 5 — availableCpuPlatforms empty

All zones returned an empty availableCpuPlatforms array. Seeded the correct platform lists for each us-central1 zone verified against real GCP (us-central1-c has a slightly different set than a/b/f).

Issue 6 — Machine type responses missing fields

Machine type responses were missing imageSpaceGb, isSharedCpu, maximumPersistentDisks, and maximumPersistentDisksSizeGb. Added all fields with values verified against real GCP for all 10 machine types. Also corrected descriptions to match real GCP exactly.

Issue 7 — Only one zone seeded

Only us-central1-a was seeded. Real GCP's us-central1 has four zones: a, b, c, and f. Added seeds for all four zones with correct IDs, supportsPzs values (a/b/c → true, f → false), and per-zone CPU platform lists. Updated the region's zones list accordingly.

Files Changed

  • emulators/google-compute/emulator_core/services/zone.py
  • emulators/google-compute/emulator_core/services/region.py
  • emulators/google-compute/main.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant