Skip to content

feat: transfer vnic rule#6

Merged
qingwusunny merged 1 commit intomainfrom
dpi-sync
Sep 28, 2025
Merged

feat: transfer vnic rule#6
qingwusunny merged 1 commit intomainfrom
dpi-sync

Conversation

@qingwusunny
Copy link
Collaborator

No description provided.

Copy link

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 implements a VNIC rule transfer feature that adds infrastructure to sync Tower VM NIC (VNIC) configurations and create corresponding Kubernetes Rule resources. The implementation includes a controller that watches Tower VNIC events and manages Rule CRDs based on DPI enablement status.

  • Adds Tower client integration for querying VNIC data
  • Creates a controller that syncs VNIC configurations to Kubernetes Rules
  • Updates API types to use simplified Option structure for Tower VM references

Reviewed Changes

Copilot reviewed 25 out of 26 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/tower/datamodel/ Defines Tower API data models for VNIC and common interfaces
pkg/tower/client/ Implements Tower GraphQL client with authentication and change watching
pkg/controller/vnic/ Contains the main controller logic and helper functions for VNIC-to-Rule conversion
api/trafficredirect/v1alpha1/ Updates Rule CRD structure replacing TowerOption with simplified Option
pkg/config/config.go Adds Tower configuration parameters
cmd/controller/main.go Integrates the new VNIC controller into the application

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

"github.com/everoute/trafficredirect/pkg/tower/client"
)

// mockStatusWriter 实现 client.StatusWriter 接口
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

The comment contains Chinese text that should be in English: '实现 client.StatusWriter 接口' should be 'implements client.StatusWriter interface'.

Suggested change
// mockStatusWriter 实现 client.StatusWriter 接口
// mockStatusWriter implements client.StatusWriter interface

Copilot uses AI. Check for mistakes.
return nil
}

// 辅助函数:创建测试用的 Rule 对象
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

The comment contains Chinese text that should be in English: '辅助函数:创建测试用的 Rule 对象' should be 'Helper function: create test Rule object'.

Suggested change
// 辅助函数:创建测试用的 Rule 对象
// Helper function: create test Rule object

Copilot uses AI. Check for mistakes.
@qingwusunny qingwusunny force-pushed the dpi-sync branch 2 times, most recently from 6942079 to 4279e84 Compare September 25, 2025 03:40
@wu-cl wu-cl requested a review from Copilot September 25, 2025 03:42
Copy link

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

Copilot reviewed 25 out of 26 changed files in this pull request and generated no new comments.


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

Copy link

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

Copilot reviewed 25 out of 26 changed files in this pull request and generated 1 comment.


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

Comment on lines +249 to +250
// 验证 ingress rule
ingressKey := types.NamespacedName{
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

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

The comment contains Chinese characters. It should be in English: '// Verify ingress rule'

Copilot uses AI. Check for mistakes.
@qingwusunny qingwusunny merged commit f06e906 into main Sep 28, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants