Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add wlid annotation to networkneighbors #157

Merged
merged 2 commits into from
Dec 6, 2023
Merged

add wlid annotation to networkneighbors #157

merged 2 commits into from
Dec 6, 2023

Conversation

matthyx
Copy link
Contributor

@matthyx matthyx commented Dec 6, 2023

Type

Enhancement


Description

This PR introduces several changes:

  • The wlid annotation is added to network neighbors in the network_manager.go and network_neighbors.go files. This is done by modifying the generateNetworkNeighborsCRD function to include clusterName as a parameter and using it to generate the wlid.
  • The generateNetworkNeighborsCRD function is also updated in the network_neighbors_test.go file to reflect the changes.
  • The version of inspektor-gadget is updated from v0.23.0 to v0.23.1 in the go.mod file.

Main files walkthrough

files:
  • pkg/networkmanager/network_manager.go: The generateNetworkNeighborsCRD function is called with an additional clusterName parameter. This is done in two places within the handleContainerStarted and handleNetworkEvents functions.
  • pkg/networkmanager/network_neighbors.go: The generateNetworkNeighborsCRD function is updated to include clusterName as a parameter and use it to generate the wlid for the NetworkNeighbors object.
  • pkg/networkmanager/network_neighbors_test.go: The generateNetworkNeighborsCRD function is updated in the test cases to include the clusterName parameter.
  • go.mod: The version of inspektor-gadget is updated from v0.23.0 to v0.23.1. The replace directive for inspektor-gadget is removed.
  • go.sum: The checksums for the new version of inspektor-gadget are added and the old ones are removed.

Signed-off-by: Matthias Bertschy <[email protected]>
Copy link

PR Description updated to latest commit (4f82476)

@codiumai-pr-agent-free codiumai-pr-agent-free bot added the enhancement New feature or request label Dec 6, 2023
Copy link

PR Analysis

  • 🎯 Main theme: Adding wlid annotation to network neighbors
  • 📝 PR summary: This PR introduces the 'wlid' annotation to network neighbors in the network manager and network neighbors files. The 'generateNetworkNeighborsCRD' function is updated to include 'clusterName' as a parameter, which is used to generate the 'wlid'. The version of 'inspektor-gadget' is also updated in the 'go.mod' file.
  • 📌 Type of PR: Enhancement
  • 🧪 Relevant tests added: True
  • ⏱️ Estimated effort to review [1-5]: 2, because the changes are straightforward and there are no complex logic changes.
  • 🔒 Security concerns: No security concerns found

PR Feedback

  • 💡 General suggestions: The PR is well-structured and the changes are clear. The addition of the 'wlid' annotation to network neighbors is a good enhancement. However, it would be beneficial to add more context about why this change is necessary in the PR description.

  • 🤖 Code feedback:
    • relevant file: pkg/networkmanager/network_manager.go
      suggestion: Consider handling the error from 'parentWL.GenerateWlid(clusterName)' in 'generateNetworkNeighborsCRD' function. This will ensure that the function does not fail silently if there is an error in generating the 'wlid'. [important]
      relevant line: instanceidhandler.WlidMetadataKey: parentWorkload.GenerateWlid(clusterName),

    • relevant file: pkg/networkmanager/network_neighbors_test.go
      suggestion: It would be good to add a test case to verify that the 'wlid' is correctly generated and added to the 'NetworkNeighbors' object. [medium]
      relevant line: actualNetworkNeighbors := generateNetworkNeighborsCRD(wl, selector, "minikube")

How to use

Instructions

To invoke the PR-Agent, add a comment using one of the following commands:
/review: Request a review of your Pull Request.
/describe: Update the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
/ask <QUESTION>: Ask a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.
/add_docs: Generate docstring for new components introduced in the PR.
/generate_labels: Generate labels for the PR based on the PR's contents.
see the tools guide for more details.

To edit any configuration parameter from the configuration.toml, add --config_path=new_value.
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, add a /config comment.

Copy link

github-actions bot commented Dec 6, 2023

Summary:

  • License scan: success
  • Credentials scan: success
  • Vulnerabilities scan: success
  • Unit test: success
  • Go linting: success

@matthyx matthyx added the release Create release label Dec 6, 2023
@@ -11,7 +11,7 @@ require (
github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb
github.com/google/uuid v1.4.0
github.com/goradd/maps v0.1.5
github.com/inspektor-gadget/inspektor-gadget v0.23.0
github.com/inspektor-gadget/inspektor-gadget v0.23.1
Copy link
Contributor

Choose a reason for hiding this comment

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

why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the release they did for me, fixing dns tracing on minikube

Copy link
Contributor Author

Choose a reason for hiding this comment

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

instead of using my fork

@matthyx matthyx merged commit 1667a68 into main Dec 6, 2023
6 checks passed
@matthyx matthyx deleted the wlid branch December 6, 2023 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request release Create release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants