Open
Conversation
There was a problem hiding this comment.
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-initcommand 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.
71609d2 to
6522228
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.