-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove tera config generator
Signed-off-by: iGxnon <[email protected]>
- Loading branch information
Showing
9 changed files
with
544 additions
and
683 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
/// Xline handle | ||
mod xline; | ||
|
||
pub mod consts; | ||
|
||
use serde::{Deserialize, Serialize}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
use async_trait::async_trait; | ||
use k8s_openapi::api::core::v1::Pod; | ||
use kube::api::{AttachParams, AttachedProcess}; | ||
use kube::Api; | ||
|
||
/// xline handle abstraction | ||
#[async_trait] | ||
pub trait XlineHandle { | ||
/// the err during start and kill | ||
type Err; | ||
|
||
/// start a xline node | ||
async fn start(&mut self) -> Result<(), Self::Err>; | ||
|
||
/// kill a xline node | ||
async fn kill(&mut self) -> Result<(), Self::Err>; | ||
} | ||
|
||
/// K8s xline handle | ||
pub struct K8sXlineHandle { | ||
/// the pod name | ||
pod_name: String, | ||
/// the container name of xline | ||
container_name: String, | ||
/// k8s pods api | ||
pods_api: Api<Pod>, | ||
/// the attached process of xline | ||
process: Option<AttachedProcess>, | ||
} | ||
|
||
#[async_trait] | ||
impl XlineHandle for K8sXlineHandle { | ||
type Err = kube::Error; | ||
|
||
async fn start(&mut self) -> Result<(), Self::Err> { | ||
let process = self | ||
.pods_api | ||
.exec( | ||
&self.pod_name, | ||
vec!["sh"], | ||
&AttachParams::default().container(&self.container_name), | ||
) | ||
.await?; | ||
self.process = Some(process); | ||
todo!() | ||
} | ||
|
||
async fn kill(&mut self) -> Result<(), Self::Err> { | ||
todo!() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.