Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions crates/openshell-bootstrap/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ fn diagnose_corrupted_state(gateway_name: &str) -> GatewayFailureDiagnosis {
recovery_steps: vec![
RecoveryStep::with_command(
"Destroy and recreate the gateway",
format!("openshell gateway destroy {gateway_name} && openshell gateway start"),
format!(
"openshell gateway destroy --name {gateway_name} && openshell gateway start"
),
),
RecoveryStep::with_command(
"If that fails, remove the volume for a clean slate",
Expand Down Expand Up @@ -230,7 +232,7 @@ fn diagnose_port_conflict(_gateway_name: &str) -> GatewayFailureDiagnosis {
),
RecoveryStep::with_command(
"Or stop other openshell gateways",
"openshell gateway list && openshell gateway destroy <name>",
"openshell gateway list && openshell gateway destroy --name <name>",
),
],
retryable: false,
Expand Down Expand Up @@ -283,7 +285,9 @@ fn diagnose_k3s_dns_proxy_failure(gateway_name: &str) -> GatewayFailureDiagnosis
RecoveryStep::with_command("Prune Docker networks", "docker network prune -f"),
RecoveryStep::with_command(
"Destroy and recreate the gateway",
format!("openshell gateway destroy {gateway_name} && openshell gateway start"),
format!(
"openshell gateway destroy --name {gateway_name} && openshell gateway start"
),
),
],
retryable: true,
Expand Down Expand Up @@ -342,7 +346,9 @@ fn diagnose_node_pressure(gateway_name: &str) -> GatewayFailureDiagnosis {
RecoveryStep::new("Increase Docker resource allocation or free resources on the host"),
RecoveryStep::with_command(
"Destroy and recreate the gateway after freeing resources",
format!("openshell gateway destroy {gateway_name} && openshell gateway start"),
format!(
"openshell gateway destroy --name {gateway_name} && openshell gateway start"
),
),
],
retryable: false,
Expand All @@ -365,7 +371,9 @@ fn diagnose_missing_supervisor(gateway_name: &str) -> GatewayFailureDiagnosis {
),
RecoveryStep::with_command(
"Destroy and recreate the gateway with the updated image",
format!("openshell gateway destroy {gateway_name} && openshell gateway start"),
format!(
"openshell gateway destroy --name {gateway_name} && openshell gateway start"
),
),
RecoveryStep::new(
"Or set OPENSHELL_CLUSTER_IMAGE to a cluster image version that includes \
Expand All @@ -384,7 +392,7 @@ fn diagnose_certificate_issue(gateway_name: &str) -> GatewayFailureDiagnosis {
.to_string(),
recovery_steps: vec![RecoveryStep::with_command(
"Destroy and recreate the gateway to regenerate certificates",
format!("openshell gateway destroy {gateway_name} && openshell gateway start"),
format!("openshell gateway destroy --name {gateway_name} && openshell gateway start"),
)],
retryable: false,
}
Expand Down Expand Up @@ -443,7 +451,9 @@ pub fn generic_failure_diagnosis(gateway_name: &str) -> GatewayFailureDiagnosis
recovery_steps: vec![
RecoveryStep::with_command(
"Try destroying and recreating the gateway",
format!("openshell gateway destroy {gateway_name} && openshell gateway start"),
format!(
"openshell gateway destroy --name {gateway_name} && openshell gateway start"
),
),
RecoveryStep::with_command(
"Check container logs for details",
Expand Down
2 changes: 1 addition & 1 deletion crates/openshell-bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ where
return Err(miette::miette!(
"Gateway '{name}' already exists (container_running={}).\n\
Use --recreate to destroy and redeploy, or destroy it first with:\n\n \
openshell gateway destroy {name}",
openshell gateway destroy --name {name}",
existing.container_running,
));
}
Expand Down
2 changes: 1 addition & 1 deletion crates/openshell-cli/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1900,7 +1900,7 @@ pub async fn sandbox_create(
eprintln!();
eprintln!(
" {} && {}",
format!("openshell gateway destroy {gateway_name}").cyan(),
format!("openshell gateway destroy --name {gateway_name}").cyan(),
"openshell gateway start".cyan(),
);
eprintln!();
Expand Down
Loading