Repository navigation
bug: Restore GCP metadata server support #3860
Description
User Story
As a user running a Google Cloud SDK in an OpenShell sandbox, I want the GCP metadata endpoint to be available, so that the SDK can discover project and service-account information through its standard metadata flow.
Problem Statement
The GCP metadata server/emulator is no longer available in current sandbox runtimes. The google-cloud provider example requires the gcp-metadata platform adapter, but importing, updating, or attaching that profile fails with required platform adapter 'gcp-metadata' is unavailable in this build. Workloads that rely on GCP SDK metadata discovery therefore cannot use the provider as documented.
The implementation files crates/openshell-sandbox/src/google_cloud_metadata.rs and crates/openshell-sandbox/src/metadata_server.rs were removed in PR #2942 during the runtime split. The removal was raised in PR #3775, where maintainers requested a bug to track adding the capability back.
Impact / Why This Matters
Users cannot run GCP SDKs that expect the standard metadata service inside OpenShell, including flows that obtain project and service-account details through metadata discovery. They must replace that flow with manually configured values or credentials, which is not equivalent for workloads designed to use metadata-based authentication and reduces portability across GCP environments.
Acceptance Criteria
- OpenShell provides the documented GCP metadata endpoint to sandbox workloads on supported runtimes.
- A GCP SDK can perform metadata discovery, including retrieving the expected project/service-account metadata, using the standard metadata request flow.
- Automated coverage verifies the metadata behavior and prevents an unsupported
gcp-metadataprofile from being presented as usable.
Reproduction Steps
- Use a current OpenShell build containing the runtime split from PR feat(isolation): implement the RFC 0012 sandbox architecture #2942.
- Import or attach the
google-cloudprovider profile, which declaresrequired_platform_adapter: gcp-metadata. - Observe the
required platform adapter 'gcp-metadata' is unavailable in this builderror. In builds/configurations where the profile can be attached, run a GCP SDK that querieshttp://metadata.google.internal/computeMetadata/v1/with theMetadata-Flavor: Googleheader; metadata discovery is unavailable.
Environment
- OpenShell: Current build after PR feat(isolation): implement the RFC 0012 sandbox architecture #2942 (exact version not provided)
- OS: Not specified
- Runtime, deployment, or integration: OpenShell sandbox runtime; affected compute driver not specified
Logs
required platform adapter 'gcp-metadata' is unavailable in this build
Activity
elezar commentedon Sep 30, 2026
feloy commentedon Sep 30, 2026
Implementation Plan
Issue type:
fixComplexity: Medium
Confidence: High for architecture; SDK compatibility requires Linux E2E validation
Summary
Restore the GCP metadata emulator in the supervisor, relaying the reserved
127.0.0.1:8174destination over the existing authenticated network mediation transport. Serve non-secret project/account metadata and credential placeholders from the live provider state, without moving real credentials into the sandbox.Scope
crates/openshell-core/src/google_cloud.rsandprovider_credentials.rs: shared exact metadata destination and atomic reads of explicitly non-secret current configuration.crates/openshell-sandbox/src/network_broker.rs: mediate metadata TCP before ordinary loopback routing.crates/openshell-supervisor-network/src/google_cloud_metadata.rs,lib.rs,proxy.rs: restore handler and dispatch direct/forward metadata requests locally with identity verification and bounded parsing.e2e/python/: exercise Google SDK discovery through an attached provider with synthetic credentials.docs/how-it-works/providers/google.mdxand related policy skill: document Linux runtime support and the reserved endpoint.Implementation Steps
Test Plan
Risks & Open Questions
Documentation Impact
Update provider docs to describe supervisor mediation and supported runtimes; review related skills using the sync-agent-infra maintenance map.
Revision 2 — preserve current config classification, support repeated SDK refresh, and use Podman for local E2E validation
Revision 1 — initial plan
feloy commentedon Sep 30, 2026
Implementation Complete
PR: #3973
Restored the supervisor-owned GCP metadata emulator through the existing authenticated network relay. Project/account discovery and token placeholders use current provider state; repeated SDK refresh works through the configured account alias.
Tests
mise run pre-commitandmise run cipassed.Docs updated
docs/how-it-works/providers/google.mdxskills/generate-sandbox-policy/SKILL.mdThe issue will auto-close when the PR is merged.
fix(providers): restore supervisor-backed GCP metadata discovery (NVI…
fix(providers): restore supervisor-backed GCP metadata discovery (NVI…