Skip to content

Add IPsec document content and remove unnecessary OutputMark for egress#1499

Merged
kmesh-bot merged 7 commits intokmesh-net:mainfrom
zrggw:adjust_ipsec
Oct 15, 2025
Merged

Add IPsec document content and remove unnecessary OutputMark for egress#1499
kmesh-bot merged 7 commits intokmesh-net:mainfrom
zrggw:adjust_ipsec

Conversation

@zrggw
Copy link
Copy Markdown
Contributor

@zrggw zrggw commented Sep 5, 2025

What type of PR is this?
/kind cleanup
/kind documentation

What this PR does / why we need it:

  • This pull request add content for IPsec documentation in docs/proposal/kmesh_support_encrypt.md, because previously modified the decryption.
  • IPsec Handler Modifications: Updated the createStateRule function in ipsec_handler.go to conditionally set the OutputMark only for ingress state rules, removing it from egress state rules. Because OutputMark for egress is unnecessary.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Signed-off-by: aicee <hhbin2000@foxmail.com>
Signed-off-by: aicee <hhbin2000@foxmail.com>
Signed-off-by: aicee <hhbin2000@foxmail.com>
Signed-off-by: aicee <hhbin2000@foxmail.com>
Copilot AI review requested due to automatic review settings September 5, 2025 03:06
@kmesh-bot
Copy link
Copy Markdown
Collaborator

@zrggw: The label(s) kind/documentation cannot be applied, because the repository doesn't have them.

Details

In response to this:

What type of PR is this?
/kind cleanup
/kind documentation

What this PR does / why we need it:

  • This pull request add content for IPsec documentation in docs/proposal/kmesh_support_encrypt.md, because previously modified the decryption.
  • IPsec Handler Modifications: Updated the createStateRule function in ipsec_handler.go to conditionally set the OutputMark only for ingress state rules, removing it from egress state rules. Because OutputMark for egress is unnecessary.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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.

Summary of Changes

Hello @zrggw, 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 focuses on improving the clarity and efficiency of IPsec handling within the system. It introduces detailed explanations and visual aids for how IPsec encryption and decryption are managed, making the underlying processes easier to understand. Concurrently, it optimizes the internal mechanism for configuring IPsec state rules by ensuring that specific packet markings are applied only when functionally required, streamlining network operations.

Highlights

  • IPsec Documentation Enhancement: Comprehensive documentation has been added for IPsec encryption and decryption processes, including detailed flow descriptions, mark value explanations, and new SVG flow diagrams.
  • Optimized IPsec State Rule Creation: The logic for creating IPsec state rules has been refined to conditionally apply the OutputMark only for ingress (decryption) state rules, removing it from egress rules where it is unnecessary. This improves efficiency and correctness.
  • CLI Command Update: The kmeshctl secret command example in the documentation has been updated to include the create subcommand, reflecting the correct usage.
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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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.


Packets flow unseen, IPsec guards the data's way, Secrets safe within.

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

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances IPsec functionality in Kmesh by conditionally setting OutputMark only for ingress state rules and adding comprehensive documentation for the IPsec encryption/decryption process.

  • Added detailed documentation for IPsec data encryption and decryption flows with process diagrams
  • Modified createStateRule function to conditionally set OutputMark based on ingress/egress direction
  • Updated test cases to accommodate the new function signature with ingress parameter

Reviewed Changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.

File Description
docs/proposal/kmesh_support_encrypt.md Added detailed IPsec encryption/decryption process documentation and corrected command format
pkg/controller/encryption/ipsec/ipsec_handler.go Modified createStateRule to conditionally set OutputMark only for ingress rules
pkg/controller/encryption/ipsec/ipsec_handler_test.go Updated test cases and hasStateRule function to handle conditional OutputMark

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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

This pull request enhances the IPsec documentation and refactors the IPsec handler to conditionally set the OutputMark for ingress rules only. The changes are generally good, but I've found a critical issue in the test logic that could lead to panics or incorrect results, and an inconsistency in the documentation. My review includes suggestions to fix these issues.

@zrggw zrggw marked this pull request as draft September 5, 2025 03:23
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 5, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.28%. Comparing base (62fc327) to head (c22bf91).
⚠️ Report is 138 commits behind head on main.

Files with missing lines Patch % Lines
pkg/controller/encryption/ipsec/ipsec_handler.go 75.00% 2 Missing ⚠️
Files with missing lines Coverage Δ
pkg/controller/encryption/ipsec/ipsec_handler.go 43.52% <75.00%> (+0.61%) ⬆️

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7193230...c22bf91. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: aicee <hhbin2000@foxmail.com>
Signed-off-by: aicee <hhbin2000@foxmail.com>
@zrggw zrggw marked this pull request as ready for review September 5, 2025 03:51
Signed-off-by: aicee <hhbin2000@foxmail.com>
@LiZhenCheng9527
Copy link
Copy Markdown
Contributor

/lgtm
/approve

@kmesh-bot
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: LiZhenCheng9527

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kmesh-bot kmesh-bot merged commit 3d9cfcd into kmesh-net:main Oct 15, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants