cargo fmt
This commit is contained in:
parent
f75765408d
commit
58e609767b
@ -3,10 +3,7 @@ use std::time::Duration;
|
||||
use derive_new::new;
|
||||
use k8s_openapi::{
|
||||
ClusterResourceScope, NamespaceResourceScope,
|
||||
api::{
|
||||
apps::v1::Deployment,
|
||||
core::v1::Pod,
|
||||
},
|
||||
api::{apps::v1::Deployment, core::v1::Pod},
|
||||
};
|
||||
use kube::{
|
||||
Client, Config, Error, Resource,
|
||||
@ -173,7 +170,8 @@ impl K8sClient {
|
||||
if let Some(p) = pod
|
||||
&& let Some(status) = p.status
|
||||
&& let Some(phase) = status.phase
|
||||
&& phase.to_lowercase() == "running" {
|
||||
&& phase.to_lowercase() == "running"
|
||||
{
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
|
@ -183,13 +183,10 @@ pub(crate) fn get_health_check_for_backend(
|
||||
match uppercase {
|
||||
"TCP" => {
|
||||
if let Some(checkport) = haproxy_health_check.checkport.content.as_ref()
|
||||
&& !checkport.is_empty() {
|
||||
&& !checkport.is_empty()
|
||||
{
|
||||
return Some(HealthCheck::TCP(Some(checkport.parse().unwrap_or_else(
|
||||
|_| {
|
||||
panic!(
|
||||
"HAProxy check port should be a valid port number, got {checkport}"
|
||||
)
|
||||
},
|
||||
|_| panic!("HAProxy check port should be a valid port number, got {checkport}"),
|
||||
))));
|
||||
}
|
||||
Some(HealthCheck::TCP(None))
|
||||
|
@ -10,10 +10,7 @@ use crate::{
|
||||
inventory::Inventory,
|
||||
modules::helm::chart::{HelmChartScore, HelmRepository},
|
||||
score::Score,
|
||||
topology::{
|
||||
HelmCommand, K8sclient, Topology, ingress::Ingress,
|
||||
k8s::K8sClient,
|
||||
},
|
||||
topology::{HelmCommand, K8sclient, Topology, ingress::Ingress, k8s::K8sClient},
|
||||
};
|
||||
use harmony_types::id::Id;
|
||||
|
||||
|
@ -194,10 +194,10 @@ impl RustWebapp {
|
||||
Some(body_full(tar_data.into())),
|
||||
);
|
||||
|
||||
while let Some(mut msg) = image_build_stream.next().await {
|
||||
while let Some(msg) = image_build_stream.next().await {
|
||||
trace!("Got bollard msg {msg:?}");
|
||||
match msg {
|
||||
Ok(mut msg) => {
|
||||
Ok(msg) => {
|
||||
if let Some(progress) = msg.progress_detail {
|
||||
info!(
|
||||
"Build progress {}/{}",
|
||||
@ -511,25 +511,23 @@ ingress:
|
||||
fs::write(chart_dir.join("values.yaml"), values_yaml)?;
|
||||
|
||||
// Create templates/_helpers.tpl
|
||||
let helpers_tpl = format!(
|
||||
r#"
|
||||
{{{{/*
|
||||
let helpers_tpl = r#"
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}}}
|
||||
{{{{- define "chart.name" -}}}}
|
||||
{{{{- default .Chart.Name $.Values.nameOverride | trunc 63 | trimSuffix "-" }}}}
|
||||
{{{{- end }}}}
|
||||
*/}}
|
||||
{{- define "chart.name" -}}
|
||||
{{- default .Chart.Name $.Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{{{/*
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
*/}}}}
|
||||
{{{{- define "chart.fullname" -}}}}
|
||||
{{{{- $name := default .Chart.Name $.Values.nameOverride }}}}
|
||||
{{{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}}}
|
||||
{{{{- end }}}}
|
||||
"#
|
||||
);
|
||||
*/}}
|
||||
{{- define "chart.fullname" -}}
|
||||
{{- $name := default .Chart.Name $.Values.nameOverride }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
"#.to_string();
|
||||
fs::write(templates_dir.join("_helpers.tpl"), helpers_tpl)?;
|
||||
|
||||
// Create templates/service.yaml
|
||||
|
@ -107,7 +107,8 @@ impl HelmCommandExecutor {
|
||||
|
||||
pub fn run_command(mut self, mut args: Vec<String>) -> Result<Output, std::io::Error> {
|
||||
if let Some(d) = self.debug
|
||||
&& d {
|
||||
&& d
|
||||
{
|
||||
args.push("--debug".to_string());
|
||||
}
|
||||
|
||||
@ -233,22 +234,26 @@ impl HelmChart {
|
||||
}
|
||||
|
||||
if let Some(crd) = self.include_crds
|
||||
&& crd {
|
||||
&& crd
|
||||
{
|
||||
args.push("--include-crds".to_string());
|
||||
}
|
||||
|
||||
if let Some(st) = self.skip_tests
|
||||
&& st {
|
||||
&& st
|
||||
{
|
||||
args.push("--skip-tests".to_string());
|
||||
}
|
||||
|
||||
if let Some(sh) = self.skip_hooks
|
||||
&& sh {
|
||||
&& sh
|
||||
{
|
||||
args.push("--no-hooks".to_string());
|
||||
}
|
||||
|
||||
if let Some(d) = self.debug
|
||||
&& d {
|
||||
&& d
|
||||
{
|
||||
args.push("--debug".to_string());
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
use kube::CustomResource;
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -104,7 +104,9 @@ impl OKDSetup02BootstrapInterpret {
|
||||
InterpretError::new(format!("Failed to create okd installation directory : {e}"))
|
||||
})?;
|
||||
if !exit_status.success() {
|
||||
return Err(InterpretError::new("Failed to create okd installation directory".to_string()));
|
||||
return Err(InterpretError::new(
|
||||
"Failed to create okd installation directory".to_string(),
|
||||
));
|
||||
} else {
|
||||
info!(
|
||||
"Created OKD installation directory {}",
|
||||
|
@ -183,7 +183,8 @@ impl CephRemoveOsdInterpret {
|
||||
|
||||
if let Some(deployment) = dep
|
||||
&& let Some(status) = deployment.status
|
||||
&& status.replicas.unwrap_or(1) == 0 && status.ready_replicas.unwrap_or(1) == 0
|
||||
&& status.replicas.unwrap_or(1) == 0
|
||||
&& status.ready_replicas.unwrap_or(1) == 0
|
||||
{
|
||||
return Ok(Outcome::success(
|
||||
"Deployment successfully scaled down.".to_string(),
|
||||
|
Loading…
Reference in New Issue
Block a user