You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[release-1.34]feat: implement tagsList-based Interconnect Group ID retrieval from IMDS (#10007)
* Label node with Interconnect Group ID (placeholder implementation)
What type of PR is this?
/kind feature
What this PR does / why we need it:
This adds the infrastructure/plumbing code for Interconnect Group node labeling but with a placeholder implementation that returns empty string. This allows the infrastructure to be in place and tested without breaking anything, while the actual IMDS parsing implementation can be added later when the format is finalized.
Which issue(s) this PR fixes:
N/A (New feature - infrastructure preparation)
Special notes for your reviewer:
Changes:
- pkg/consts: Add LabelInterconnectGroup constant
- pkg/provider: Add GetInterconnectGroupId method (returns empty)
- pkg/nodemanager: Add GetInterconnectGroupId to interface and integration code
- pkg/node: Implement GetInterconnectGroupId for both IMDS and ARM providers (both return empty)
- pkg/provider: Add minimal unit test
Behavior:
- GetInterconnectGroupId() always returns ("", nil)
- No label is applied to nodes
- No errors, nothing breaks
- Infrastructure is ready for future implementation
This approach allows:
1. Code review and testing of the infrastructure separately
2. Future IMDS parsing logic to be added without modifying the interface
3. Safe deployment - guaranteed not to break anything
4. No assumptions about IMDS format (no TagsList or other structures added)
Does this PR introduce a user-facing change?
NONE
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
NONE
* Implement TagsList-based Interconnect Group ID retrieval from IMDS
This commit implements the actual IMDS parsing logic to retrieve the
Platform Interconnect Group ID from Azure instance metadata using the
tagsList field.
Implementation changes:
- Add TagNameInterconnectGroup constant for the IMDS tag name
- Add Tag struct to represent IMDS tag key-value pairs
- Add TagsList field to ComputeMetadata struct for JSON unmarshaling
- Implement GetInterconnectGroupID to parse tagsList and extract
Platform_Interconnect_Group tag value
- Add comprehensive tests with HTTP mock server:
* Tag present in tagsList
* Tag absent from tagsList
* Empty tagsList
* UseInstanceMetadata disabled
Test updates:
- Update TestNodeInitialized and TestUpdateCloudNode to verify
Interconnect Group labeling alongside PlatformSubFaultDomain
- Tests return actual group IDs and validate labels are set correctly
This builds on the infrastructure from PR #9559 which added the label
constant and placeholder function.
* fix: address review feedback for Interconnect Group ID retrieval
---------
Co-authored-by: wtao <wtao@microsoft.com>
0 commit comments