Skip to content

chore: master to test#115

Merged
mayankpande88 merged 17 commits into
testfrom
main
Mar 27, 2025
Merged

chore: master to test#115
mayankpande88 merged 17 commits into
testfrom
main

Conversation

@mayankpande88
Copy link
Copy Markdown
Contributor

No description provided.

mayankpande88 and others added 17 commits February 19, 2025 11:52
fix: fix for garbage data and host mapping
fix: add trace in alert label
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.33.0 to 0.36.0.
- [Commits](golang/net@v0.33.0...v0.36.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
…g/x/net-0.36.0

build(deps): bump golang.org/x/net from 0.33.0 to 0.36.0
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 25.0.3+incompatible to 25.0.6+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](moby/moby@v25.0.3...v25.0.6)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://github.com/Azure/azure-sdk-for-go) from 1.5.1 to 1.6.0.
- [Release notes](https://github.com/Azure/azure-sdk-for-go/releases)
- [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md)
- [Commits](Azure/azure-sdk-for-go@sdk/internal/v1.5.1...sdk/azcore/v1.6.0)

---
updated-dependencies:
- dependency-name: github.com/Azure/azure-sdk-for-go/sdk/azidentity
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.6.26 to 1.6.38.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](containerd/containerd@v1.6.26...v1.6.38)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [github.com/golang-jwt/jwt/v5](https://github.com/golang-jwt/jwt) from 5.2.1 to 5.2.2.
- [Release notes](https://github.com/golang-jwt/jwt/releases)
- [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md)
- [Commits](golang-jwt/jwt@v5.2.1...v5.2.2)

---
updated-dependencies:
- dependency-name: github.com/golang-jwt/jwt/v5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
…m/golang-jwt/jwt/v5-5.2.2

build(deps): bump github.com/golang-jwt/jwt/v5 from 5.2.1 to 5.2.2
…m/containerd/containerd-1.6.38

build(deps): bump github.com/containerd/containerd from 1.6.26 to 1.6.38
Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

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!

Summary of Changes

This pull request appears to be a synchronization from the master branch to the test branch, as indicated by the title. The changes include modifications to common/ip_resolver.go, containers/container.go, containers/l7.go, containers/registry.go, ebpftracer/tracer.go, go.mod, and tracing/tracing.go. The most significant changes involve resolving pod owners, enhancing L7 metrics with trace IDs, and improving payload handling in the eBPF tracer.

Highlights

  • IP Resolver Enhancement: A new function ResolvePodOwner is added to common/ip_resolver.go to resolve the owner of a pod, and the getControllerOfOwner function is modified to directly return the owner.
  • Container Metadata Enrichment: The NewContainer function in containers/container.go is updated to resolve the source workload of a container using the ResolvePodOwner function and log the pod's owner information.
  • L7 Metrics Enhancement: The L7Stats struct in containers/l7.go is updated to include trace IDs in L7 metrics, and logic is added to extract the host from HTTP requests when the destination namespace is external.
  • eBPF Tracer Payload Handling: The runEventsReader function in ebpftracer/tracer.go is modified to improve payload handling by checking payload sizes and safely copying payload and response data.
  • Tracing Headers: The tracing/tracing.go file is updated to extract trace IDs from HTTP headers.
  • Dependency Updates: The go.mod and go.sum files are updated to reflect changes in dependencies, including containerd, docker, golang.org/x/net, golang.org/x/sys, and other indirect dependencies.

Changelog

Click here to see the changelog
  • common/ip_resolver.go
    • Modified getControllerOfOwner to directly return the owner.
    • Added ResolvePodOwner function to resolve the owner of a pod.
  • containers/container.go
    • Modified container ID splitting to extract namespace and pod name.
    • Added logic to resolve and log pod owner information.
    • Updated NewContainer to use resolved workload as source workload.
  • containers/l7.go
    • Modified L7Stats.get to include trace ID.
    • Added logic to extract host from HTTP requests for external destinations.
  • containers/registry.go
    • Added ResolvePodOwner to the IPResolver interface.
  • ebpftracer/tracer.go
    • Improved payload handling in runEventsReader by checking payload sizes and safely copying data.
  • go.mod
    • Updated Go version to 1.23.0 and added toolchain go1.24.1.
    • Updated dependencies, including containerd and docker.
  • go.sum
    • Updated checksums for various dependencies.
  • tracing/tracing.go
    • Added ExtractTraceId function to extract trace IDs from HTTP headers.
    • Modified HttpRequest to use ExtractTraceId.
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.


Did you know?

The eBPF technology, heavily used in this project, allows sandboxed programs to run in the Linux kernel without changing kernel source code.

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.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot 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

The pull request introduces several changes to improve the observability and workload resolution capabilities of the node agent. It includes enhancements to L7 tracing, pod owner resolution, and dependency updates. The changes seem well-structured, but some areas could benefit from additional clarity and error handling.

Summary of Findings

  • Potential nil pointer dereference: In tracing/tracing.go, the headers variable might be nil when calling t.ExtractTraceId(headers), which could lead to a nil pointer dereference. Adding a nil check before calling the method would improve the code's robustness.
  • Error handling in ResolvePodOwner: The ResolvePodOwner function in common/ip_resolver.go returns a default Workload struct when an error occurs while fetching the pod. It might be better to return the error to allow the caller to handle the failure explicitly.
  • Inconsistent namespace extraction: The NewContainer function in containers/container.go extracts the namespace from the container ID string. The indices used to extract the namespace and pod name are different in the before and after versions of the code. Ensure that the correct indices are used to extract the namespace and pod name.
  • Logging external host: In containers/container.go, the external host is logged using log.Printf. Consider using klog.Infof for consistency with other logging statements in the codebase.

Merge Readiness

The pull request introduces valuable improvements, but addressing the potential nil pointer dereference and error handling issues is crucial before merging. I am unable to approve this pull request, and recommend that another reviewer also reviews this code before merging. At a minimum, the critical and high severity issues should be addressed before merging.

Comment thread tracing/tracing.go
Comment thread common/ip_resolver.go
Comment thread containers/container.go
@mayankpande88 mayankpande88 merged commit 0da28b2 into test Mar 27, 2025
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.

3 participants