-
Notifications
You must be signed in to change notification settings - Fork 10
Implemented the Main SyncLoop and Static Pod Support #70
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
Conversation
Signed-off-by: acfboy <acfboyu@outlook.com>
Signed-off-by: acfboy <acfboyu@outlook.com>
Signed-off-by: acfboy <acfboyu@outlook.com>
Signed-off-by: acfboy <acfboyu@outlook.com>
There was a problem hiding this 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 new daemon mode that continuously monitors a static pod configuration directory and synchronizes pod states using a main sync loop. Key changes include:
- Adding Clone derivations and refactoring file-based task initialization in task.rs.
- Introducing a daemon command in main.rs to run the sync loop.
- Creating new daemon modules (sync_loop and static_pods) to support periodic static pod checking.
- Updating cli_commands to integrate the new task runner functionality.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
project/rkl/src/task.rs | Adds Clone to key structs and refactors task initialization methods. |
project/rkl/src/main.rs | Introduces the Daemon command and initializes tracing for logging. |
project/rkl/src/lib.rs | Exposes the new daemon module. |
project/rkl/src/daemon/sync_loop.rs | Implements the main sync loop and event registration. |
project/rkl/src/daemon/static_pods.rs | Implements static pod checking and synchronization logic. |
project/rkl/src/cli_commands.rs | Adjusts pod startup functions to use the new task runner setup. |
@@ -38,9 +38,13 @@ enum Commands { | ||
pod_name: String, | ||
}, | ||
Exec(Box<rkl::commands::exec_cli::Exec>), | ||
// Run as a daemon process. | ||
// For convenient, I won't remove cli part now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Review the inline comment regarding retaining the CLI code for daemon execution; consider clarifying its intent or removing it for production clarity.
// For convenient, I won't remove cli part now. | |
// The Daemon command is retained in the CLI for development and testing purposes. |
Copilot uses AI. Check for mistakes.
…undle path Signed-off-by: acfboy <acfboyu@outlook.com>
Signed-off-by: acfboy <acfboyu@outlook.com>
Signed-off-by: acfboy <acfboyu@outlook.com>
…ove tracing Signed-off-by: acfboy <acfboyu@outlook.com>
…countering a network creation error during pod creation. Signed-off-by: acfboy <acfboyu@outlook.com>
Signed-off-by: acfboy <acfboyu@outlook.com>
Add a new endpoint at /container/{container_id}/json to query the status of a container. This endpoint is available on port 10250 and returns a JSON response with the container status information. Signed-off-by: acfboy <acfboyu@outlook.com>
Signed-off-by: acfboy <acfboyu@outlook.com>
Signed-off-by: acfboy <acfboyu@outlook.com>
实现了 #71 中的功能。顺便修复了原先创建网络失败时没有正确错误处理(删除创建的容器)的 bug。
实现了:
/etc/rk8s/manifests
目录下的 pod 配置文件和当前运行的 pod 情况是否一致,并使运行的 pod 和目录下的配置保持一致。