Skip to content

Commit

Permalink
fix: Remove unnecesary params from spec
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalezzfelipe committed Nov 1, 2024
1 parent 423139f commit c4d9d80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 35 deletions.
16 changes: 0 additions & 16 deletions bootstrap/stage1/crd.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,6 @@ resource "kubernetes_manifest" "customresourcedefinition_hydradoomnodes_hydra_do
}
"type" = "array"
}
"configmap" = {
"nullable" = true
"type" = "string"
}
"image" = {
"nullable" = true
"type" = "string"
}
"initialUtxoAddress" = {
"nullable" = true
"type" = "string"
Expand All @@ -81,10 +73,6 @@ resource "kubernetes_manifest" "customresourcedefinition_hydradoomnodes_hydra_do
"nullable" = true
"type" = "boolean"
}
"openHeadImage" = {
"nullable" = true
"type" = "string"
}
"participant" = {
"type" = "string"
}
Expand All @@ -94,10 +82,6 @@ resource "kubernetes_manifest" "customresourcedefinition_hydradoomnodes_hydra_do
"seedInput" = {
"type" = "string"
}
"sidecarImage" = {
"nullable" = true
"type" = "string"
}
}
"required" = [
"commitInputs",
Expand Down
24 changes: 5 additions & 19 deletions src/custom_resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,9 @@ pub static HYDRA_DOOM_NODE_FINALIZER: &str = "hydradoomnode/finalizer";
"#)]
#[serde(rename_all = "camelCase")]
pub struct HydraDoomNodeSpec {
pub image: Option<String>,
pub offline: Option<bool>,
pub initial_utxo_address: Option<String>,
pub open_head_image: Option<String>,
pub sidecar_image: Option<String>,
pub configmap: Option<String>,
// Open head
pub network_id: u8,
pub seed_input: String,
pub participant: String,
Expand Down Expand Up @@ -172,7 +169,7 @@ impl HydraDoomNode {
spec: Some(PodSpec {
init_containers: Some(vec![Container {
name: "init".to_string(),
image: Some(self.spec.image.clone().unwrap_or(config.image.clone())),
image: Some(config.image.clone()),
args: Some(vec![
"gen-hydra-key".to_string(),
"--output-file".to_string(),
Expand All @@ -188,9 +185,7 @@ impl HydraDoomNode {
containers: vec![
Container {
name: "main".to_string(),
image: Some(
self.spec.image.clone().unwrap_or(config.image.clone()),
),
image: Some(config.image.clone()),
args: Some(vec![
"offline".to_string(),
"--host".to_string(),
Expand Down Expand Up @@ -238,12 +233,7 @@ impl HydraDoomNode {
},
Container {
name: "sidecar".to_string(),
image: Some(
self.spec
.sidecar_image
.clone()
.unwrap_or(config.sidecar_image.clone()),
),
image: Some(config.sidecar_image.clone()),
args: Some(vec![
"metrics-exporter".to_string(),
"--host".to_string(),
Expand Down Expand Up @@ -281,11 +271,7 @@ impl HydraDoomNode {
Volume {
name: "config".to_string(),
config_map: Some(ConfigMapVolumeSource {
name: self
.spec
.configmap
.clone()
.unwrap_or(config.configmap.clone()),
name: config.configmap.clone(),
..Default::default()
}),
..Default::default()
Expand Down

0 comments on commit c4d9d80

Please sign in to comment.