Skip to content

support metadata service#49

Open
valner wants to merge 6 commits intomainfrom
migrate-metdata-service
Open

support metadata service#49
valner wants to merge 6 commits intomainfrom
migrate-metdata-service

Conversation

@valner
Copy link
Copy Markdown
Collaborator

@valner valner commented Feb 17, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 17, 2026 15:24
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for retrieving metadata from an Instance Metadata Service (IMDS) with fallback mechanisms. The implementation replaces direct cloud-init command execution with HTTP-based metadata service calls, includes caching with TTL, and maintains backward compatibility with file-based metadata retrieval.

Changes:

  • Replaced cloud-init command execution with HTTP-based IMDS requests for fetching instance metadata
  • Added caching mechanism with 5-minute TTL for instance data to reduce redundant network calls
  • Implemented fallback logic: IMDS primary → IMDS fallback URL → local files

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/metadata/metadata.go Core implementation of IMDS client with caching, fallback URLs, and file-based fallback
internal/metadata/metadata_test.go Comprehensive test suite covering IMDS requests, caching, TTL expiration, and fallback scenarios
internal/config/config.go Updated default configuration with IMDS URLs and token type
internal/client/client.go Renamed variable from cloudInitFallback to instanceIdFallback to reflect new implementation
internal/client/client_test.go Updated mock calls to match new GetInstanceId signature with three return values
debian/usr/sbin/nebius-observability-agent-updater-run.sh Modified to fetch updater endpoint override from IMDS instead of local file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@valner valner force-pushed the migrate-metdata-service branch from 71609d2 to 6522228 Compare March 11, 2026 12:39
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.

2 participants