mirror of
https://github.com/jlengrand/engine.git
synced 2026-03-10 08:11:21 +00:00
wip: format
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
use crate::cloud_provider::common::kubernetes::get_stateless_resource_information_for_user;
|
||||
use crate::cloud_provider::service::Service;
|
||||
use crate::cloud_provider::DeploymentTarget;
|
||||
pub use mongodb::MongoDB;
|
||||
pub use mysql::MySQL;
|
||||
pub use postgresql::PostgreSQL;
|
||||
pub use redis::Redis;
|
||||
|
||||
use crate::cloud_provider::common::kubernetes::get_stateless_resource_information_for_user;
|
||||
use crate::cloud_provider::service::Service;
|
||||
use crate::cloud_provider::DeploymentTarget;
|
||||
|
||||
mod mongodb;
|
||||
mod mysql;
|
||||
mod postgresql;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use std::fs::File;
|
||||
use std::str::FromStr;
|
||||
|
||||
use itertools::Itertools;
|
||||
@@ -7,6 +8,7 @@ use tera::Context as TeraContext;
|
||||
|
||||
use crate::cloud_provider::aws::kubernetes::node::Node;
|
||||
use crate::cloud_provider::aws::AWS;
|
||||
use crate::cloud_provider::common::worker_node_data_template::WorkerNodeDataTemplate;
|
||||
use crate::cloud_provider::environment::Environment;
|
||||
use crate::cloud_provider::kubernetes::{Kind, Kubernetes, KubernetesNode, Resources};
|
||||
use crate::cloud_provider::{kubernetes, CloudProvider};
|
||||
@@ -23,7 +25,6 @@ use crate::models::{
|
||||
use crate::string::terraform_list_format;
|
||||
use crate::unit_conversion::{cpu_string_to_float, ki_to_mi};
|
||||
use crate::{dns_provider, s3};
|
||||
use std::fs::File;
|
||||
|
||||
pub mod node;
|
||||
|
||||
@@ -787,11 +788,3 @@ impl<'a> Listen for EKS<'a> {
|
||||
fn get_s3_kubeconfig_bucket_name(id: String) -> String {
|
||||
format!("qovery-kubeconfigs-{}", id)
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
struct WorkerNodeDataTemplate {
|
||||
instance_type: String,
|
||||
desired_size: String,
|
||||
max_size: String,
|
||||
min_size: String,
|
||||
}
|
||||
|
||||
@@ -281,6 +281,7 @@ impl Pause for Application {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::cloud_provider::service::Application for Application {
|
||||
fn image(&self) -> &Image {
|
||||
&self.image
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
use tera::Context as TeraContext;
|
||||
|
||||
use crate::cloud_provider::kubernetes::Kubernetes;
|
||||
use crate::cloud_provider::service::{Create, DatabaseOptions};
|
||||
use crate::cloud_provider::DeploymentTarget;
|
||||
use crate::error::EngineError;
|
||||
use crate::models::{Action, Context, Environment};
|
||||
use tera::Context as TeraContext;
|
||||
|
||||
pub struct PostgreSQL {
|
||||
context: Context,
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
use crate::cmd::utilities;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::borrow::Borrow;
|
||||
use std::collections::hash_map::RandomState;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::cmd::utilities;
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DoVpc {
|
||||
id: String,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use crate::cloud_provider::kubernetes::KubernetesNode;
|
||||
use std::any::Any;
|
||||
|
||||
use crate::cloud_provider::kubernetes::KubernetesNode;
|
||||
|
||||
pub struct Node {
|
||||
instance_type: String,
|
||||
}
|
||||
@@ -46,4 +47,4 @@ impl KubernetesNode for Node {
|
||||
fn as_any(&self) -> &dyn Any {
|
||||
self
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
pub mod api_structs;
|
||||
pub mod application;
|
||||
pub mod common;
|
||||
pub mod databases;
|
||||
pub mod kubernetes;
|
||||
pub(crate) mod router;
|
||||
|
||||
extern crate digitalocean;
|
||||
|
||||
use std::any::Any;
|
||||
@@ -16,6 +9,13 @@ use crate::constants::DIGITAL_OCEAN_TOKEN;
|
||||
use crate::error::{EngineError, EngineErrorCause};
|
||||
use crate::models::{Context, Listener, Listeners};
|
||||
|
||||
pub mod api_structs;
|
||||
pub mod application;
|
||||
pub mod common;
|
||||
pub mod databases;
|
||||
pub mod kubernetes;
|
||||
pub(crate) mod router;
|
||||
|
||||
pub struct DO {
|
||||
context: Context,
|
||||
id: String,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
use std::any::Any;
|
||||
use std::fs::File;
|
||||
use std::thread;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -9,8 +11,6 @@ use crate::cmd::kubectl;
|
||||
use crate::dns_provider::DnsProvider;
|
||||
use crate::error::{EngineError, EngineErrorCause, EngineErrorScope};
|
||||
use crate::models::{Context, Listen, ListenersHelper, ProgressInfo, ProgressLevel, ProgressScope};
|
||||
use std::fs::File;
|
||||
use std::thread;
|
||||
|
||||
pub trait Kubernetes: Listen {
|
||||
fn context(&self) -> &Context;
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
use std::net::TcpStream;
|
||||
|
||||
use retry::delay::Fixed;
|
||||
use retry::OperationResult;
|
||||
use tera::Context as TeraContext;
|
||||
use trust_dns_resolver::config::{ResolverConfig, ResolverOpts};
|
||||
use trust_dns_resolver::Resolver;
|
||||
|
||||
use crate::build_platform::Image;
|
||||
use crate::cloud_provider::environment::Environment;
|
||||
@@ -8,10 +12,6 @@ use crate::cloud_provider::kubernetes::Kubernetes;
|
||||
use crate::cloud_provider::DeploymentTarget;
|
||||
use crate::error::{EngineError, EngineErrorCause, EngineErrorScope};
|
||||
use crate::models::{Context, Listen, ListenersHelper, ProgressInfo, ProgressLevel, ProgressScope};
|
||||
use retry::delay::Fixed;
|
||||
use retry::OperationResult;
|
||||
use trust_dns_resolver::config::{ResolverConfig, ResolverOpts};
|
||||
use trust_dns_resolver::Resolver;
|
||||
|
||||
pub trait Service {
|
||||
fn context(&self) -> &Context;
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
use std::io::Error;
|
||||
use std::path::Path;
|
||||
|
||||
use tracing::{error, info, span, Level};
|
||||
|
||||
use crate::cmd::structs::{Helm, HelmHistoryRow};
|
||||
use crate::cmd::utilities::exec_with_envs_and_output;
|
||||
use crate::error::{SimpleError, SimpleErrorKind};
|
||||
use std::io::Error;
|
||||
use std::path::Path;
|
||||
use tracing::{error, info, span, Level};
|
||||
|
||||
const HELM_DEFAULT_TIMEOUT_IN_SECONDS: u32 = 300;
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use dirs::home_dir;
|
||||
use retry::delay::Fixed;
|
||||
use retry::OperationResult;
|
||||
|
||||
use crate::cmd::utilities::exec_with_envs_and_output;
|
||||
use crate::constants::TF_PLUGIN_CACHE_DIR;
|
||||
use crate::error::{SimpleError, SimpleErrorKind};
|
||||
use retry::delay::Fixed;
|
||||
use retry::OperationResult;
|
||||
|
||||
fn terraform_exec_with_init_validate_plan(root_dir: &str) -> Result<(), SimpleError> {
|
||||
// terraform init
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
extern crate reqwest;
|
||||
|
||||
use reqwest::StatusCode;
|
||||
|
||||
use crate::build_platform::Image;
|
||||
use crate::cmd;
|
||||
use crate::container_registry::{ContainerRegistry, EngineError, Kind, PushResult};
|
||||
use crate::error::EngineErrorCause;
|
||||
use crate::models::{Context, Listener, Listeners};
|
||||
extern crate reqwest;
|
||||
|
||||
use reqwest::StatusCode;
|
||||
pub struct DockerHub {
|
||||
context: Context,
|
||||
id: String,
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
use std::path::Path;
|
||||
|
||||
use rusoto_core::{Client, HttpClient, Region};
|
||||
use rusoto_credential::StaticProvider;
|
||||
use rusoto_s3::{GetObjectRequest, S3Client, S3};
|
||||
use std::path::Path;
|
||||
use tokio::{fs::File, io};
|
||||
|
||||
pub(crate) async fn download_space_object(
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
use std::ffi::OsStr;
|
||||
use std::fs;
|
||||
use std::fs::File;
|
||||
use std::io::{Write};
|
||||
use std::io::Write;
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
use std::path::Path;
|
||||
|
||||
use crate::error::{SimpleError, SimpleErrorKind};
|
||||
use tera::Error as TeraError;
|
||||
use tera::{Context, Tera};
|
||||
use walkdir::WalkDir;
|
||||
|
||||
use crate::error::{SimpleError, SimpleErrorKind};
|
||||
|
||||
pub fn generate_and_copy_all_files_into_dir<S, P>(
|
||||
from_dir: S,
|
||||
to_dir: P,
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
use crate::error::StringError;
|
||||
use core::option::Option::{None, Some};
|
||||
use core::result::Result;
|
||||
use core::result::Result::{Err, Ok};
|
||||
|
||||
use crate::error::StringError;
|
||||
|
||||
// unfortunately some proposed versions are not SemVer like Elasticache (6.x)
|
||||
// this is why we need ot have our own structure
|
||||
pub struct VersionsNumber {
|
||||
|
||||
Reference in New Issue
Block a user