Skip to content

fix: fix for external domain resolution#148

Merged
mayankpande88 merged 7 commits into
mainfrom
fix-az-labels
Jul 2, 2025
Merged

fix: fix for external domain resolution#148
mayankpande88 merged 7 commits into
mainfrom
fix-az-labels

Conversation

@mayankpande88

Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary of Changes

Hello @mayankpande88, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request implements a fix for external domain resolution by significantly enhancing the DestinationKey struct to capture more granular information about external destinations, such as their actual IP and workload details. This improvement provides a more robust and complete representation of external network traffic, which in turn enables a cleaner and more self-contained interface for processing L7 requests.

Highlights

  • Enhanced External Destination Representation: The DestinationKey struct is now populated with more comprehensive details for external IP destinations within the NewDestinationKey function. This includes setting actualDestination, destinationWorkload (with Kind: "external" and Name: domain.FQDN), and actualDestinationWorkload (with Kind: "external" and Name: actualDst.IP().String()) when an external IP and domain are identified. This provides richer context for external network flows.
  • Streamlined L7 Request Processing: The onL7Request method call on container objects has been simplified by removing the r.ip2fqdn argument. This suggests that the necessary domain resolution information is now either derived internally within the method or available through other means, likely benefiting from the enhanced DestinationKey information.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request aims to fix external domain resolution. Key changes include:

  1. In common/net.go, NewDestinationKey now populates destinationWorkload and actualDestinationWorkload with more detailed information when handling external domains that don't have a specific IP tied to their FQDN. This enhances the data captured for such scenarios.
  2. In containers/registry.go, the call to Container.onL7Request within the L7 event handler has been refactored, removing one of its arguments.

My review has identified a critical issue:

  • The change in containers/registry.go introduces a call to Container.onL7Request with an incorrect number of arguments, which will likely cause a compilation error based on the provided containers/container.go file content. This needs immediate attention.

Additionally, a medium-severity suggestion for common/net.go is to use defined constants for the string literal "external" to improve code maintainability.

Comment thread containers/registry.go
Comment thread common/net.go
@mayankpande88 mayankpande88 merged commit 41c2ef3 into main Jul 2, 2025
1 check passed
@mayankpande88 mayankpande88 deleted the fix-az-labels branch July 2, 2025 07:05
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