Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

gossion
Copy link
Member

@gossion gossion commented Jul 18, 2025

This pull request introduces support for managing and retrieving information about private endpoints in Azure Kubernetes Service (AKS) clusters. The changes include updates to the Azure client, new helper functions for private endpoint handling, and new tools and tests for private endpoint functionality.

Azure client updates:

  • Added PrivateEndpointsClient to the SubscriptionClients struct and initialized it in GetOrCreateClientsForSubscription. [1] [2] [3]
  • Implemented GetPrivateEndpoint and GetPrivateEndpointByID methods to retrieve private endpoint details.

Private endpoint functionality:

  • Created GetPrivateEndpointIDFromAKS in resourcehelpers/privateendpointhelpers.go to extract the private endpoint ID for AKS clusters.
  • Added functionality to find private endpoints in a node resource group.

New tools and handlers:

  • Added GetPrivateEndpointInfoHandler to retrieve private endpoint information via a new tool get_private_endpoint_info. [1] [2]
  • Registered the new tool in the server.

Testing:

  • Added unit tests for private endpoint helper functions, including GetPrivateEndpointIDFromAKS and extractSubscriptionIDFromCluster.
  • Added tests for GetPrivateEndpointInfoHandler to validate parameter handling and tool registration. [1] [2]

Copy link
Member

@feiskyer feiskyer left a comment

Choose a reason for hiding this comment

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

Code Review Issues

1. Resource ID Validation Missing

File: internal/azureclient/client.go:347
Issue: No validation that the parsed resource ID is actually for a private endpoint.
Suggestion: Add validation to ensure the resource type is Microsoft.Network/privateEndpoints after parsing.

2. Context Propagation Issue

File: internal/components/network/handlers.go:297
Issue: Using context.Background() instead of propagating context from the handler.
Suggestion: Add context parameter to the handler function signature and propagate it through the call chain.

3. Minor Naming Inconsistency

File: internal/components/network/resourcehelpers/privateendpointhelpers.go:89
Suggestion: Consider renaming to getSubscriptionIDFromCluster for consistency with other getter functions.

4. Missing Timeout Configuration

Suggestion: Consider adding timeout configuration for Azure API calls to improve resilience.

Overall, this is a high-quality implementation with comprehensive test coverage. The issues identified are minor and don't affect core functionality.

internal/azureclient/client.go Show resolved Hide resolved
Copy link
Member

@feiskyer feiskyer left a comment

Choose a reason for hiding this comment

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

Thanks addressing comments

@feiskyer feiskyer merged commit 0c7c58c into main Jul 18, 2025
9 checks passed
@feiskyer feiskyer deleted the guwe/pe branch July 18, 2025 08:01
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.