Merge branch 'dev' into feat/ENG_1181_del_replaced_PENDING_pods

This commit is contained in:
MacLikorne
2022-05-10 17:33:01 +02:00
committed by GitHub
14 changed files with 37 additions and 19 deletions

View File

@@ -35,8 +35,8 @@ jobs:
cargo clippy --all --all-features --lib -- -D warnings || (echo "Solve your clippy warnings to continue"; exit 1)
export PATH=$GITHUB_WORKSPACE/bin:$PATH
export RUSTC_WRAPPER=$GITHUB_WORKSPACE/bin/sccache
export SCCACHE_REDIS=${{ secrets.SCCACHE_REDIS }}
export TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache
export SCCACHE_REDIS=${{ secrets.SCCACHE_REDIS }}
mkdir -p $GITHUB_WORKSPACE/bin $HOME/.terraform.d/plugin-cache
curl -sLo $GITHUB_WORKSPACE/bin/sccache https://github.com/Qovery/sccache-bin/releases/download/${{ steps.sccache_release.outputs.value }}/sccache
chmod 755 $GITHUB_WORKSPACE/bin/sccache

View File

@@ -335,7 +335,7 @@ pub fn ec2_aws_helm_charts(
organization_long_id: &chart_config_prerequisites.organization_long_id,
cluster_id: &chart_config_prerequisites.cluster_id,
cluster_long_id: &chart_config_prerequisites.cluster_long_id,
cluster_token: &chart_config_prerequisites.infra_options.qovery_cluster_secret_token,
cluster_jwt_token: &chart_config_prerequisites.infra_options.jwt_token,
grpc_url: &chart_config_prerequisites.infra_options.qovery_grpc_url,
};
let cluster_agent = get_chart_for_cluster_agent(cluster_agent_context, chart_path)?;
@@ -346,7 +346,7 @@ pub fn ec2_aws_helm_charts(
organization_long_id: &chart_config_prerequisites.organization_long_id,
cluster_id: &chart_config_prerequisites.cluster_id,
cluster_long_id: &chart_config_prerequisites.cluster_long_id,
cluster_token: &chart_config_prerequisites.infra_options.qovery_cluster_secret_token,
cluster_jwt_token: &chart_config_prerequisites.infra_options.jwt_token,
grpc_url: &chart_config_prerequisites.infra_options.qovery_grpc_url,
};
let shell_agent = get_chart_for_shell_agent(shell_context, chart_path)?;

View File

@@ -990,7 +990,7 @@ datasources:
organization_long_id: &chart_config_prerequisites.organization_long_id,
cluster_id: &chart_config_prerequisites.cluster_id,
cluster_long_id: &chart_config_prerequisites.cluster_long_id,
cluster_token: &chart_config_prerequisites.infra_options.qovery_cluster_secret_token,
cluster_jwt_token: &chart_config_prerequisites.infra_options.jwt_token,
grpc_url: &chart_config_prerequisites.infra_options.qovery_grpc_url,
};
let cluster_agent = get_chart_for_cluster_agent(cluster_agent_context, chart_path)?;
@@ -1001,7 +1001,7 @@ datasources:
organization_long_id: &chart_config_prerequisites.organization_long_id,
cluster_id: &chart_config_prerequisites.cluster_id,
cluster_long_id: &chart_config_prerequisites.cluster_long_id,
cluster_token: &chart_config_prerequisites.infra_options.qovery_cluster_secret_token,
cluster_jwt_token: &chart_config_prerequisites.infra_options.jwt_token,
grpc_url: &chart_config_prerequisites.infra_options.qovery_grpc_url,
};
let shell_agent = get_chart_for_shell_agent(shell_context, chart_path)?;

View File

@@ -65,8 +65,11 @@ impl fmt::Display for VpcQoveryNetworkMode {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Options {
// AWS related
#[serde(default)] // TODO: remove default
pub ec2_zone_a_subnet_blocks: Vec<String>,
#[serde(default)] // TODO: remove default
pub ec2_zone_b_subnet_blocks: Vec<String>,
#[serde(default)] // TODO: remove default
pub ec2_zone_c_subnet_blocks: Vec<String>,
pub eks_zone_a_subnet_blocks: Vec<String>,
pub eks_zone_b_subnet_blocks: Vec<String>,
@@ -86,9 +89,11 @@ pub struct Options {
pub vpc_qovery_network_mode: VpcQoveryNetworkMode,
pub vpc_cidr_block: String,
pub eks_cidr_subnet: String,
#[serde(default)] // TODO: remove default
pub ec2_cidr_subnet: String,
pub vpc_custom_routing_table: Vec<VpcCustomRoutingTable>,
pub eks_access_cidr_blocks: Vec<String>,
#[serde(default)] // TODO: remove default
pub ec2_access_cidr_blocks: Vec<String>,
pub rds_cidr_subnet: String,
pub documentdb_cidr_subnet: String,
@@ -98,6 +103,7 @@ pub struct Options {
pub qovery_api_url: String,
pub qovery_grpc_url: String,
pub qovery_cluster_secret_token: String,
pub jwt_token: String,
pub qovery_engine_location: EngineLocation,
pub engine_version_controller_token: String,
pub agent_version_controller_token: String,

View File

@@ -19,7 +19,7 @@ impl InstanceType for AwsInstancesType {
fn to_cloud_provider_format(&self) -> String {
match self {
AwsInstancesType::T2Large => "t2.large",
AwsInstancesType::T2Xlarge => "t2x.large",
AwsInstancesType::T2Xlarge => "t2.xlarge",
AwsInstancesType::T3Large => "t3.large",
AwsInstancesType::T3Xlarge => "t3.xlarge",
AwsInstancesType::T3aMedium => "t3a.medium",
@@ -34,7 +34,7 @@ impl AwsInstancesType {
pub fn as_str(&self) -> &str {
match self {
AwsInstancesType::T2Large => "t2.large",
AwsInstancesType::T2Xlarge => "t2x.large",
AwsInstancesType::T2Xlarge => "t2.xlarge",
AwsInstancesType::T3Large => "t3.large",
AwsInstancesType::T3Xlarge => "t3.xlarge",
AwsInstancesType::T3aMedium => "t3a.medium",
@@ -48,7 +48,7 @@ impl fmt::Display for AwsInstancesType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
AwsInstancesType::T2Large => write!(f, "t2.large"),
AwsInstancesType::T2Xlarge => write!(f, "t2x.large"),
AwsInstancesType::T2Xlarge => write!(f, "t2.xlarge"),
AwsInstancesType::T3Large => write!(f, "t3.large"),
AwsInstancesType::T3Xlarge => write!(f, "t3.xlarge"),
AwsInstancesType::T3aMedium => write!(f, "t3a.medium"),
@@ -64,7 +64,7 @@ impl FromStr for AwsInstancesType {
fn from_str(s: &str) -> Result<AwsInstancesType, CommandError> {
match s {
"t2.large" => Ok(AwsInstancesType::T2Large),
"t2x.large" => Ok(AwsInstancesType::T2Xlarge),
"t2.xlarge" => Ok(AwsInstancesType::T2Xlarge),
"t3.large" => Ok(AwsInstancesType::T3Large),
"t3.xlarge" => Ok(AwsInstancesType::T3Xlarge),
"t3a.medium" => Ok(AwsInstancesType::T3aMedium),

View File

@@ -801,7 +801,7 @@ datasources:
organization_long_id: &chart_config_prerequisites.organization_long_id,
cluster_id: &chart_config_prerequisites.cluster_id,
cluster_long_id: &chart_config_prerequisites.cluster_long_id,
cluster_token: &chart_config_prerequisites.infra_options.qovery_cluster_secret_token,
cluster_jwt_token: &chart_config_prerequisites.infra_options.jwt_token,
grpc_url: &chart_config_prerequisites.infra_options.qovery_grpc_url,
};
let cluster_agent = get_chart_for_cluster_agent(cluster_agent_context, chart_path)?;
@@ -812,7 +812,7 @@ datasources:
organization_long_id: &chart_config_prerequisites.organization_long_id,
cluster_id: &chart_config_prerequisites.cluster_id,
cluster_long_id: &chart_config_prerequisites.cluster_long_id,
cluster_token: &chart_config_prerequisites.infra_options.qovery_cluster_secret_token,
cluster_jwt_token: &chart_config_prerequisites.infra_options.jwt_token,
grpc_url: &chart_config_prerequisites.infra_options.qovery_grpc_url,
};
let shell_agent = get_chart_for_shell_agent(shell_context, chart_path)?;

View File

@@ -76,6 +76,7 @@ pub struct DoksOptions {
pub qovery_api_url: String,
pub qovery_grpc_url: String,
pub qovery_cluster_secret_token: String,
pub jwt_token: String,
pub qovery_engine_location: EngineLocation,
pub engine_version_controller_token: String,
pub agent_version_controller_token: String,

View File

@@ -717,7 +717,7 @@ pub struct ShellAgentContext<'a> {
pub organization_long_id: &'a Uuid,
pub cluster_id: &'a str,
pub cluster_long_id: &'a Uuid,
pub cluster_token: &'a str,
pub cluster_jwt_token: &'a str,
pub grpc_url: &'a str,
}
@@ -758,8 +758,8 @@ pub fn get_chart_for_shell_agent(
value: context.grpc_url.to_string(),
},
ChartSetValue {
key: "environmentVariables.CLUSTER_TOKEN".to_string(),
value: context.cluster_token.to_string(),
key: "environmentVariables.CLUSTER_JWT_TOKEN".to_string(),
value: context.cluster_jwt_token.to_string(),
},
ChartSetValue {
key: "environmentVariables.CLUSTER_ID".to_string(),
@@ -800,7 +800,7 @@ pub struct ClusterAgentContext<'a> {
pub organization_long_id: &'a Uuid,
pub cluster_id: &'a str,
pub cluster_long_id: &'a Uuid,
pub cluster_token: &'a str,
pub cluster_jwt_token: &'a str,
pub grpc_url: &'a str,
}
@@ -842,8 +842,8 @@ pub fn get_chart_for_cluster_agent(
value: context.grpc_url.to_string(),
},
ChartSetValue {
key: "environmentVariables.CLUSTER_TOKEN".to_string(),
value: context.cluster_token.to_string(),
key: "environmentVariables.CLUSTER_JWT_TOKEN".to_string(),
value: context.cluster_jwt_token.to_string(),
},
ChartSetValue {
key: "environmentVariables.CLUSTER_ID".to_string(),

View File

@@ -674,7 +674,7 @@ datasources:
organization_long_id: &chart_config_prerequisites.organization_long_id,
cluster_id: &chart_config_prerequisites.cluster_id,
cluster_long_id: &chart_config_prerequisites.cluster_long_id,
cluster_token: &chart_config_prerequisites.infra_options.qovery_cluster_secret_token,
cluster_jwt_token: &chart_config_prerequisites.infra_options.jwt_token,
grpc_url: &chart_config_prerequisites.infra_options.qovery_grpc_url,
};
let cluster_agent = get_chart_for_cluster_agent(cluster_agent_context, chart_path)?;
@@ -685,7 +685,7 @@ datasources:
organization_long_id: &chart_config_prerequisites.organization_long_id,
cluster_id: &chart_config_prerequisites.cluster_id,
cluster_long_id: &chart_config_prerequisites.cluster_long_id,
cluster_token: &chart_config_prerequisites.infra_options.qovery_cluster_secret_token,
cluster_jwt_token: &chart_config_prerequisites.infra_options.jwt_token,
grpc_url: &chart_config_prerequisites.infra_options.qovery_grpc_url,
};
let shell_agent = get_chart_for_shell_agent(shell_context, chart_path)?;

View File

@@ -63,6 +63,7 @@ pub struct KapsuleOptions {
pub qovery_api_url: String,
pub qovery_grpc_url: String,
pub qovery_cluster_secret_token: String,
pub jwt_token: String,
pub qovery_nats_url: String,
pub qovery_nats_user: String,
pub qovery_nats_password: String,
@@ -89,6 +90,7 @@ impl KapsuleOptions {
qovery_api_url: String,
qovery_grpc_url: String,
qovery_cluster_secret_token: String,
qoverry_cluster_jwt_token: String,
qovery_nats_url: String,
qovery_nats_user: String,
qovery_nats_password: String,
@@ -107,6 +109,7 @@ impl KapsuleOptions {
qovery_api_url,
qovery_grpc_url,
qovery_cluster_secret_token,
jwt_token: qoverry_cluster_jwt_token,
qovery_nats_url,
qovery_nats_user,
qovery_nats_password,

View File

@@ -248,6 +248,7 @@ impl Cluster<AWS, Options> for AWS {
tls_email_report: secrets.LETS_ENCRYPT_EMAIL_REPORT.unwrap(),
qovery_grpc_url: secrets.QOVERY_GRPC_URL.unwrap(),
qovery_cluster_secret_token: secrets.QOVERY_CLUSTER_SECRET_TOKEN.unwrap(),
jwt_token: secrets.QOVERY_CLUSTER_JWT_TOKEN.unwrap(),
}
}
}

View File

@@ -149,6 +149,7 @@ impl Cluster<DO, DoksOptions> for DO {
qovery_api_url: secrets.QOVERY_API_URL.unwrap(),
qovery_grpc_url: secrets.QOVERY_GRPC_URL.unwrap(),
qovery_cluster_secret_token: secrets.QOVERY_CLUSTER_SECRET_TOKEN.unwrap(),
jwt_token: "".to_string(),
qovery_engine_location: EngineLocation::ClientSide,
engine_version_controller_token: secrets.QOVERY_ENGINE_CONTROLLER_TOKEN.unwrap(),
agent_version_controller_token: secrets.QOVERY_AGENT_CONTROLLER_TOKEN.unwrap(),

View File

@@ -171,6 +171,9 @@ impl Cluster<Scaleway, KapsuleOptions> for Scaleway {
secrets
.QOVERY_CLUSTER_SECRET_TOKEN
.expect("QOVERY_CLUSTER_SECRET_TOKEN is not set in secrets"),
secrets
.QOVERY_CLUSTER_JWT_TOKEN
.expect("QOVERY_CLUSTER_JWT_TOKEN is not set in secrets"),
secrets.QOVERY_NATS_URL.expect("QOVERY_NATS_URL is not set in secrets"),
secrets
.QOVERY_NATS_USERNAME

View File

@@ -148,6 +148,7 @@ pub struct FuncTestsSecrets {
pub TERRAFORM_AWS_REGION: Option<String>,
pub QOVERY_GRPC_URL: Option<String>,
pub QOVERY_CLUSTER_SECRET_TOKEN: Option<String>,
pub QOVERY_CLUSTER_JWT_TOKEN: Option<String>,
}
struct VaultConfig {
@@ -238,6 +239,7 @@ impl FuncTestsSecrets {
TERRAFORM_AWS_REGION: None,
QOVERY_GRPC_URL: None,
QOVERY_CLUSTER_SECRET_TOKEN: None,
QOVERY_CLUSTER_JWT_TOKEN: None,
};
let vault_config = match Self::get_vault_config() {
@@ -358,6 +360,7 @@ impl FuncTestsSecrets {
"QOVERY_CLUSTER_SECRET_TOKEN",
secrets.QOVERY_CLUSTER_SECRET_TOKEN,
),
QOVERY_CLUSTER_JWT_TOKEN: Self::select_secret("QOVERY_CLUSTER_JWT_TOKEN", secrets.QOVERY_CLUSTER_JWT_TOKEN),
}
}
}