feat: Initial helm score using helm-wrapper-rs #14
@ -7,7 +7,7 @@ license.workspace = true
|
||||
|
||||
[dependencies]
|
||||
libredfish = "0.1.1"
|
||||
reqwest = {version = "0.11", features = ["blocking", "json"] }
|
||||
reqwest = { version = "0.11", features = ["blocking", "json"] }
|
||||
russh = "0.45.0"
|
||||
rust-ipmi = "0.1.1"
|
||||
semver = "1.0.23"
|
||||
|
1
harmony/src/modules/helm/mod.rs
Normal file
1
harmony/src/modules/helm/mod.rs
Normal file
@ -0,0 +1 @@
|
||||
pub mod resource;
|
63
harmony/src/modules/helm/resource.rs
Normal file
63
harmony/src/modules/helm/resource.rs
Normal file
@ -0,0 +1,63 @@
|
||||
use crate::data::{Id, Version};
|
||||
use crate::interpret::{Interpret, InterpretError, InterpretName, InterpretStatus, Outcome};
|
||||
use crate::inventory::Inventory;
|
||||
use crate::score::Score;
|
||||
use crate::topology::Topology;
|
||||
use async_trait::async_trait;
|
||||
use helm_wrapper_rs;
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub struct HelmResourceScore {
|
||||
pub namespace: String,
|
||||
pub release_name: String,
|
||||
pub chart_name: String,
|
||||
pub chart_version: String,
|
||||
pub values_overrides: String,
|
||||
pub values_file: String,
|
||||
|
||||
pub helm_options: String,
|
||||
}
|
||||
|
||||
impl<T: Topology + std::fmt::Debug + Sync + Default + serde::Serialize + 'static + Send + Clone>
|
||||
Score<T> for HelmResourceScore
|
||||
{
|
||||
fn create_interpret(&self) -> Box<dyn Interpret<T>> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn name(&self) -> String {
|
||||
format!("{}, {}", self.release_name, self.chart_name)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct HelmResourceInterpret {
|
||||
pub score: HelmResourceScore,
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<T: Topology + Clone + std::fmt::Debug + serde::Serialize + Default + Send + Sync> Interpret<T>
|
||||
for HelmResourceInterpret
|
||||
{
|
||||
async fn execute(
|
||||
&self,
|
||||
_inventory: &Inventory,
|
||||
topology: &T,
|
||||
) -> Result<Outcome, InterpretError> {
|
||||
Ok(Outcome::success(
|
||||
"Successfully applied resource".to_string(),
|
||||
))
|
||||
}
|
||||
fn get_name(&self) -> InterpretName {
|
||||
todo!()
|
||||
}
|
||||
fn get_version(&self) -> Version {
|
||||
todo!()
|
||||
}
|
||||
fn get_status(&self) -> InterpretStatus {
|
||||
todo!()
|
||||
}
|
||||
fn get_children(&self) -> Vec<Id> {
|
||||
todo!()
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
pub mod dhcp;
|
||||
pub mod dns;
|
||||
pub mod dummy;
|
||||
pub mod helm;
|
||||
pub mod http;
|
||||
pub mod k3d;
|
||||
pub mod k8s;
|
||||
|
Loading…
Reference in New Issue
Block a user
Needs to be optional here so we can decide at runtime which namespace we're deploying to. For example, when we're deploying a staging stack we should be able to specify "stack-staging" or "stack-prod" or "stack-pullrequestno435"