mirror of
https://github.com/jlengrand/engine.git
synced 2026-03-10 08:11:21 +00:00
Add new variables for agent (#464)
Co-authored-by: Benjamin <benjamin.chastanier@gmail.com>
This commit is contained in:
committed by
GitHub
parent
b74c46167b
commit
97f33c8a3c
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
/target
|
||||
**/target
|
||||
*.iml
|
||||
.idea
|
||||
.qovery-workspace
|
||||
@@ -11,4 +11,4 @@ results.json
|
||||
lib/kubernetes_config_*
|
||||
tests/assets/eks-options.json
|
||||
tests/assets/do-options.json
|
||||
Dockerfile
|
||||
Dockerfile
|
||||
|
||||
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -3230,6 +3230,7 @@ dependencies = [
|
||||
"time 0.2.27",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"uuid 0.8.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -24,6 +24,7 @@ reqwest = { version = "0.11.3", features = ["blocking", "json"] }
|
||||
futures = "0.3.15"
|
||||
timeout-readwrite = "0.3.1"
|
||||
lazy_static = "1.4.0"
|
||||
uuid = { version = "0.8", features = ["v4"] }
|
||||
|
||||
# FIXME use https://crates.io/crates/blocking instead of runtime.rs
|
||||
|
||||
|
||||
@@ -30,7 +30,9 @@ pub struct AwsQoveryTerraformConfig {
|
||||
|
||||
pub struct ChartsConfigPrerequisites {
|
||||
pub organization_id: String,
|
||||
pub organization_long_id: uuid::Uuid,
|
||||
pub cluster_id: String,
|
||||
pub cluster_long_id: uuid::Uuid,
|
||||
pub region: String,
|
||||
pub cluster_name: String,
|
||||
pub cloud_provider: String,
|
||||
@@ -987,6 +989,26 @@ datasources:
|
||||
key: "replicaCount".to_string(),
|
||||
value: "1".to_string(),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.GRPC_SERVER".to_string(),
|
||||
value: chart_config_prerequisites.infra_options.qovery_grpc_url.to_string(),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.CLUSTER_TOKEN".to_string(),
|
||||
value: chart_config_prerequisites
|
||||
.infra_options
|
||||
.qovery_cluster_secret_token
|
||||
.to_string(),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.CLUSTER_ID".to_string(),
|
||||
value: chart_config_prerequisites.cluster_long_id.to_string(),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.ORGANIZATION_ID".to_string(),
|
||||
value: chart_config_prerequisites.organization_long_id.to_string(),
|
||||
},
|
||||
// TODO: Remove those values after the migration
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.NATS_HOST_URL".to_string(),
|
||||
value: chart_config_prerequisites.infra_options.qovery_nats_url.to_string(),
|
||||
@@ -1002,10 +1024,6 @@ datasources:
|
||||
.qovery_nats_password
|
||||
.to_string(),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.LOKI_URL".to_string(),
|
||||
value: format!("http://{}.cluster.local:3100", loki_kube_dns_prefix),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.CLOUD_REGION".to_string(),
|
||||
value: chart_config_prerequisites.region.clone(),
|
||||
@@ -1018,6 +1036,11 @@ datasources:
|
||||
key: "environmentVariables.KUBERNETES_ID".to_string(),
|
||||
value: chart_config_prerequisites.cluster_id.clone(),
|
||||
},
|
||||
// TODO: End of the todo
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.LOKI_URL".to_string(),
|
||||
value: format!("http://{}.cluster.local:3100", loki_kube_dns_prefix),
|
||||
},
|
||||
// resources limits
|
||||
ChartSetValue {
|
||||
key: "resources.limits.cpu".to_string(),
|
||||
|
||||
@@ -91,6 +91,8 @@ pub struct Options {
|
||||
pub elasticsearch_cidr_subnet: String,
|
||||
// Qovery
|
||||
pub qovery_api_url: String,
|
||||
pub qovery_grpc_url: String,
|
||||
pub qovery_cluster_secret_token: String,
|
||||
pub qovery_engine_location: Option<EngineLocation>,
|
||||
pub engine_version_controller_token: String,
|
||||
pub agent_version_controller_token: String,
|
||||
@@ -108,6 +110,7 @@ pub struct Options {
|
||||
pub struct EKS<'a> {
|
||||
context: Context,
|
||||
id: String,
|
||||
long_id: uuid::Uuid,
|
||||
name: String,
|
||||
version: String,
|
||||
region: Region,
|
||||
@@ -124,6 +127,7 @@ impl<'a> EKS<'a> {
|
||||
pub fn new(
|
||||
context: Context,
|
||||
id: &str,
|
||||
long_id: uuid::Uuid,
|
||||
name: &str,
|
||||
version: &str,
|
||||
region: &str,
|
||||
@@ -146,6 +150,7 @@ impl<'a> EKS<'a> {
|
||||
EKS {
|
||||
context,
|
||||
id: id.to_string(),
|
||||
long_id,
|
||||
name: name.to_string(),
|
||||
version: version.to_string(),
|
||||
region: Region::from_str(region).unwrap(),
|
||||
@@ -911,8 +916,10 @@ impl<'a> Kubernetes for EKS<'a> {
|
||||
.collect();
|
||||
let charts_prerequisites = ChartsConfigPrerequisites {
|
||||
organization_id: self.cloud_provider.organization_id().to_string(),
|
||||
organization_long_id: self.cloud_provider.organization_long_id,
|
||||
infra_options: self.options.clone(),
|
||||
cluster_id: self.id.clone(),
|
||||
cluster_long_id: self.long_id,
|
||||
region: self.region().to_string(),
|
||||
cluster_name: self.cluster_name().to_string(),
|
||||
cloud_provider: "aws".to_string(),
|
||||
|
||||
@@ -19,6 +19,7 @@ pub struct AWS {
|
||||
context: Context,
|
||||
id: String,
|
||||
organization_id: String,
|
||||
organization_long_id: uuid::Uuid,
|
||||
name: String,
|
||||
pub access_key_id: String,
|
||||
pub secret_access_key: String,
|
||||
@@ -31,6 +32,7 @@ impl AWS {
|
||||
context: Context,
|
||||
id: &str,
|
||||
organization_id: &str,
|
||||
organization_long_id: uuid::Uuid,
|
||||
name: &str,
|
||||
access_key_id: &str,
|
||||
secret_access_key: &str,
|
||||
@@ -40,6 +42,7 @@ impl AWS {
|
||||
context,
|
||||
id: id.to_string(),
|
||||
organization_id: organization_id.to_string(),
|
||||
organization_long_id,
|
||||
name: name.to_string(),
|
||||
access_key_id: access_key_id.to_string(),
|
||||
secret_access_key: secret_access_key.to_string(),
|
||||
|
||||
@@ -22,7 +22,9 @@ pub struct DigitalOceanQoveryTerraformConfig {
|
||||
|
||||
pub struct ChartsConfigPrerequisites {
|
||||
pub organization_id: String,
|
||||
pub organization_long_id: uuid::Uuid,
|
||||
pub cluster_id: String,
|
||||
pub cluster_long_id: uuid::Uuid,
|
||||
pub do_cluster_id: String,
|
||||
pub region: String,
|
||||
pub cluster_name: String,
|
||||
@@ -52,7 +54,9 @@ pub struct ChartsConfigPrerequisites {
|
||||
impl ChartsConfigPrerequisites {
|
||||
pub fn new(
|
||||
organization_id: String,
|
||||
organization_long_id: uuid::Uuid,
|
||||
cluster_id: String,
|
||||
cluster_long_id: uuid::Uuid,
|
||||
do_cluster_id: String,
|
||||
region: String,
|
||||
cluster_name: String,
|
||||
@@ -79,7 +83,9 @@ impl ChartsConfigPrerequisites {
|
||||
) -> Self {
|
||||
ChartsConfigPrerequisites {
|
||||
organization_id,
|
||||
organization_long_id,
|
||||
cluster_id,
|
||||
cluster_long_id,
|
||||
do_cluster_id,
|
||||
region,
|
||||
cluster_name,
|
||||
@@ -812,6 +818,26 @@ datasources:
|
||||
key: "replicaCount".to_string(),
|
||||
value: "1".to_string(),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.GRPC_SERVER".to_string(),
|
||||
value: chart_config_prerequisites.infra_options.qovery_grpc_url.to_string(),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.CLUSTER_TOKEN".to_string(),
|
||||
value: chart_config_prerequisites
|
||||
.infra_options
|
||||
.qovery_cluster_secret_token
|
||||
.to_string(),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.CLUSTER_ID".to_string(),
|
||||
value: chart_config_prerequisites.cluster_long_id.to_string(),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.ORGANIZATION_ID".to_string(),
|
||||
value: chart_config_prerequisites.organization_long_id.to_string(),
|
||||
},
|
||||
// TODO: Remove those values after the migration
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.NATS_HOST_URL".to_string(),
|
||||
value: chart_config_prerequisites.infra_options.qovery_nats_url.to_string(),
|
||||
@@ -827,22 +853,15 @@ datasources:
|
||||
.qovery_nats_password
|
||||
.to_string(),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.LOKI_URL".to_string(),
|
||||
value: format!("http://{}.cluster.local:3100", loki_kube_dns_prefix),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.CLOUD_REGION".to_string(),
|
||||
value: chart_config_prerequisites.region.clone(),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.CLOUD_PROVIDER".to_string(),
|
||||
value: "do".to_string(),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.KUBERNETES_ID".to_string(),
|
||||
value: chart_config_prerequisites.cluster_id.clone(),
|
||||
},
|
||||
// TODO: End of the todo
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.LOKI_URL".to_string(),
|
||||
value: format!("http://{}.cluster.local:3100", loki_kube_dns_prefix),
|
||||
},
|
||||
// resources limits
|
||||
ChartSetValue {
|
||||
key: "resources.limits.cpu".to_string(),
|
||||
|
||||
@@ -58,6 +58,8 @@ pub struct DoksOptions {
|
||||
pub vpc_cidr_set: VpcInitKind,
|
||||
// Qovery
|
||||
pub qovery_api_url: String,
|
||||
pub qovery_grpc_url: String,
|
||||
pub qovery_cluster_secret_token: String,
|
||||
pub qovery_engine_location: Option<EngineLocation>,
|
||||
pub engine_version_controller_token: String,
|
||||
pub agent_version_controller_token: String,
|
||||
@@ -75,6 +77,7 @@ pub struct DoksOptions {
|
||||
pub struct DOKS<'a> {
|
||||
context: Context,
|
||||
id: String,
|
||||
long_id: uuid::Uuid,
|
||||
name: String,
|
||||
version: String,
|
||||
region: Region,
|
||||
@@ -91,6 +94,7 @@ impl<'a> DOKS<'a> {
|
||||
pub fn new(
|
||||
context: Context,
|
||||
id: String,
|
||||
long_id: uuid::Uuid,
|
||||
name: String,
|
||||
version: String,
|
||||
region: Region,
|
||||
@@ -113,6 +117,7 @@ impl<'a> DOKS<'a> {
|
||||
DOKS {
|
||||
context,
|
||||
id,
|
||||
long_id,
|
||||
name,
|
||||
version,
|
||||
region,
|
||||
@@ -659,8 +664,10 @@ impl<'a> Kubernetes for DOKS<'a> {
|
||||
|
||||
let charts_prerequisites = ChartsConfigPrerequisites {
|
||||
organization_id: self.cloud_provider.organization_id().to_string(),
|
||||
organization_long_id: self.cloud_provider.organization_long_id,
|
||||
infra_options: self.options.clone(),
|
||||
cluster_id: self.id.clone(),
|
||||
cluster_long_id: self.long_id,
|
||||
do_cluster_id: doks_id,
|
||||
region: self.region().to_string(),
|
||||
cluster_name: self.cluster_name().to_string(),
|
||||
|
||||
@@ -21,6 +21,7 @@ pub struct DO {
|
||||
context: Context,
|
||||
id: String,
|
||||
organization_id: String,
|
||||
organization_long_id: uuid::Uuid,
|
||||
name: String,
|
||||
pub token: String,
|
||||
spaces_access_id: String,
|
||||
@@ -34,6 +35,7 @@ impl DO {
|
||||
context: Context,
|
||||
id: &str,
|
||||
organization_id: &str,
|
||||
organization_long_id: uuid::Uuid,
|
||||
token: &str,
|
||||
spaces_access_id: &str,
|
||||
spaces_secret_key: &str,
|
||||
@@ -44,6 +46,7 @@ impl DO {
|
||||
context,
|
||||
id: id.to_string(),
|
||||
organization_id: organization_id.to_string(),
|
||||
organization_long_id,
|
||||
name: name.to_string(),
|
||||
token: token.to_string(),
|
||||
spaces_access_id: spaces_access_id.to_string(),
|
||||
|
||||
@@ -19,7 +19,9 @@ pub struct ScalewayQoveryTerraformConfig {
|
||||
|
||||
pub struct ChartsConfigPrerequisites {
|
||||
pub organization_id: String,
|
||||
pub organization_long_id: uuid::Uuid,
|
||||
pub cluster_id: String,
|
||||
pub cluster_long_id: uuid::Uuid,
|
||||
pub zone: Zone,
|
||||
pub region: Region,
|
||||
pub cluster_name: String,
|
||||
@@ -47,7 +49,9 @@ pub struct ChartsConfigPrerequisites {
|
||||
impl ChartsConfigPrerequisites {
|
||||
pub fn new(
|
||||
organization_id: String,
|
||||
organization_long_id: uuid::Uuid,
|
||||
cluster_id: String,
|
||||
cluster_long_id: uuid::Uuid,
|
||||
zone: Zone,
|
||||
cluster_name: String,
|
||||
cloud_provider: String,
|
||||
@@ -71,7 +75,9 @@ impl ChartsConfigPrerequisites {
|
||||
) -> Self {
|
||||
ChartsConfigPrerequisites {
|
||||
organization_id,
|
||||
organization_long_id,
|
||||
cluster_id,
|
||||
cluster_long_id,
|
||||
zone,
|
||||
region: zone.region(),
|
||||
cluster_name,
|
||||
@@ -692,6 +698,26 @@ datasources:
|
||||
key: "replicaCount".to_string(),
|
||||
value: "1".to_string(),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.GRPC_SERVER".to_string(),
|
||||
value: chart_config_prerequisites.infra_options.qovery_grpc_url.to_string(),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.CLUSTER_TOKEN".to_string(),
|
||||
value: chart_config_prerequisites
|
||||
.infra_options
|
||||
.qovery_cluster_secret_token
|
||||
.to_string(),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.CLUSTER_ID".to_string(),
|
||||
value: chart_config_prerequisites.cluster_long_id.to_string(),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.ORGANIZATION_ID".to_string(),
|
||||
value: chart_config_prerequisites.organization_long_id.to_string(),
|
||||
},
|
||||
// TODO: Remove those values after the migration
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.NATS_HOST_URL".to_string(),
|
||||
value: chart_config_prerequisites.infra_options.qovery_nats_url.to_string(),
|
||||
@@ -707,10 +733,6 @@ datasources:
|
||||
.qovery_nats_password
|
||||
.to_string(),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.LOKI_URL".to_string(),
|
||||
value: format!("http://{}.cluster.local:3100", loki_kube_dns_prefix),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.CLOUD_REGION".to_string(),
|
||||
value: chart_config_prerequisites.zone.to_string(),
|
||||
@@ -723,6 +745,11 @@ datasources:
|
||||
key: "environmentVariables.KUBERNETES_ID".to_string(),
|
||||
value: chart_config_prerequisites.organization_id.clone(),
|
||||
},
|
||||
ChartSetValue {
|
||||
key: "environmentVariables.LOKI_URL".to_string(),
|
||||
value: format!("http://{}.cluster.local:3100", loki_kube_dns_prefix),
|
||||
},
|
||||
// TODO: End of the todo
|
||||
// resources limits
|
||||
ChartSetValue {
|
||||
key: "resources.limits.cpu".to_string(),
|
||||
|
||||
@@ -41,6 +41,8 @@ use tera::Context as TeraContext;
|
||||
pub struct KapsuleOptions {
|
||||
// Qovery
|
||||
pub qovery_api_url: String,
|
||||
pub qovery_grpc_url: String,
|
||||
pub qovery_cluster_secret_token: String,
|
||||
pub qovery_nats_url: String,
|
||||
pub qovery_nats_user: String,
|
||||
pub qovery_nats_password: String,
|
||||
@@ -63,6 +65,8 @@ pub struct KapsuleOptions {
|
||||
impl KapsuleOptions {
|
||||
pub fn new(
|
||||
qovery_api_url: String,
|
||||
qovery_grpc_url: String,
|
||||
qovery_cluster_secret_token: String,
|
||||
qovery_nats_url: String,
|
||||
qovery_nats_user: String,
|
||||
qovery_nats_password: String,
|
||||
@@ -79,6 +83,8 @@ impl KapsuleOptions {
|
||||
) -> KapsuleOptions {
|
||||
KapsuleOptions {
|
||||
qovery_api_url,
|
||||
qovery_grpc_url,
|
||||
qovery_cluster_secret_token,
|
||||
qovery_nats_url,
|
||||
qovery_nats_user,
|
||||
qovery_nats_password,
|
||||
@@ -99,6 +105,7 @@ impl KapsuleOptions {
|
||||
pub struct Kapsule<'a> {
|
||||
context: Context,
|
||||
id: String,
|
||||
long_id: uuid::Uuid,
|
||||
name: String,
|
||||
version: String,
|
||||
zone: Zone,
|
||||
@@ -115,6 +122,7 @@ impl<'a> Kapsule<'a> {
|
||||
pub fn new(
|
||||
context: Context,
|
||||
id: String,
|
||||
long_id: uuid::Uuid,
|
||||
name: String,
|
||||
version: String,
|
||||
zone: Zone,
|
||||
@@ -139,6 +147,7 @@ impl<'a> Kapsule<'a> {
|
||||
Kapsule {
|
||||
context,
|
||||
id,
|
||||
long_id,
|
||||
name,
|
||||
version,
|
||||
zone,
|
||||
@@ -539,7 +548,9 @@ impl<'a> Kubernetes for Kapsule<'a> {
|
||||
|
||||
let charts_prerequisites = ChartsConfigPrerequisites::new(
|
||||
self.cloud_provider.organization_id().to_string(),
|
||||
self.cloud_provider.organization_long_id,
|
||||
self.id().to_string(),
|
||||
self.long_id,
|
||||
self.zone,
|
||||
self.cluster_name(),
|
||||
"scw".to_string(),
|
||||
|
||||
@@ -14,9 +14,10 @@ pub struct Scaleway {
|
||||
id: String,
|
||||
name: String,
|
||||
organization_id: String,
|
||||
pub access_key: String,
|
||||
pub secret_key: String,
|
||||
pub project_id: String,
|
||||
organization_long_id: uuid::Uuid,
|
||||
access_key: String,
|
||||
secret_key: String,
|
||||
project_id: String,
|
||||
terraform_state_credentials: TerraformStateCredentials,
|
||||
listeners: Listeners,
|
||||
}
|
||||
@@ -26,6 +27,7 @@ impl Scaleway {
|
||||
context: Context,
|
||||
id: &str,
|
||||
organization_id: &str,
|
||||
organization_long_id: uuid::Uuid,
|
||||
name: &str,
|
||||
access_key: &str,
|
||||
secret_key: &str,
|
||||
@@ -36,6 +38,7 @@ impl Scaleway {
|
||||
context,
|
||||
id: id.to_string(),
|
||||
organization_id: organization_id.to_string(),
|
||||
organization_long_id,
|
||||
name: name.to_string(),
|
||||
access_key: access_key.to_string(),
|
||||
secret_key: secret_key.to_string(),
|
||||
|
||||
13
test_utilities/Cargo.lock
generated
13
test_utilities/Cargo.lock
generated
@@ -2089,6 +2089,7 @@ dependencies = [
|
||||
"tracing-subscriber",
|
||||
"tracing-test",
|
||||
"trust-dns-resolver",
|
||||
"uuid 0.8.2",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
@@ -2483,7 +2484,7 @@ dependencies = [
|
||||
"tokio-threadpool",
|
||||
"tokio-timer",
|
||||
"url 1.7.2",
|
||||
"uuid",
|
||||
"uuid 0.7.4",
|
||||
"winreg 0.6.2",
|
||||
]
|
||||
|
||||
@@ -3227,6 +3228,7 @@ dependencies = [
|
||||
"time 0.2.24",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"uuid 0.8.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3885,6 +3887,15 @@ dependencies = [
|
||||
"rand 0.6.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uuid"
|
||||
version = "0.8.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
|
||||
dependencies = [
|
||||
"getrandom 0.2.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "vcpkg"
|
||||
version = "0.2.15"
|
||||
|
||||
@@ -26,6 +26,7 @@ retry = "1.0.0"
|
||||
time = "0.2.23"
|
||||
hashicorp_vault = "2.0.1"
|
||||
maplit = "1.0.2"
|
||||
uuid = { version = "0.8", features = ["v4"] }
|
||||
|
||||
# Digital Ocean Deps
|
||||
digitalocean = "0.1.1"
|
||||
|
||||
@@ -74,6 +74,7 @@ pub fn cloud_provider_aws(context: &Context) -> AWS {
|
||||
context.clone(),
|
||||
"u8nb94c7fwxzr2jt",
|
||||
AWS_QOVERY_ORGANIZATION_ID,
|
||||
uuid::Uuid::new_v4(),
|
||||
"QoveryTest",
|
||||
secrets.AWS_ACCESS_KEY_ID.unwrap().as_str(),
|
||||
secrets.AWS_SECRET_ACCESS_KEY.unwrap().as_str(),
|
||||
@@ -163,6 +164,8 @@ pub fn eks_options(secrets: FuncTestsSecrets) -> Options {
|
||||
qovery_nats_user: secrets.QOVERY_NATS_USERNAME.unwrap(),
|
||||
qovery_nats_password: secrets.QOVERY_NATS_PASSWORD.unwrap(),
|
||||
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(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,6 +179,7 @@ pub fn aws_kubernetes_eks<'a>(
|
||||
EKS::<'a>::new(
|
||||
context.clone(),
|
||||
AWS_KUBE_TEST_CLUSTER_ID,
|
||||
uuid::Uuid::new_v4(),
|
||||
AWS_KUBE_TEST_CLUSTER_ID,
|
||||
AWS_KUBERNETES_VERSION,
|
||||
secrets.clone().AWS_DEFAULT_REGION.unwrap().as_str(),
|
||||
|
||||
@@ -68,6 +68,7 @@ pub fn do_kubernetes_ks<'a>(
|
||||
DOKS::<'a>::new(
|
||||
context.clone(),
|
||||
DO_KUBE_TEST_CLUSTER_ID.to_string(),
|
||||
uuid::Uuid::new_v4(),
|
||||
DO_KUBE_TEST_CLUSTER_NAME.to_string(),
|
||||
DO_KUBERNETES_VERSION.to_string(),
|
||||
region,
|
||||
@@ -92,6 +93,7 @@ pub fn cloud_provider_digitalocean(context: &Context) -> DO {
|
||||
context.clone(),
|
||||
DO_KUBE_TEST_CLUSTER_ID,
|
||||
DO_QOVERY_ORGANIZATION_ID,
|
||||
uuid::Uuid::new_v4(),
|
||||
secrets.DIGITAL_OCEAN_TOKEN.unwrap().as_str(),
|
||||
secrets.DIGITAL_OCEAN_SPACES_ACCESS_ID.unwrap().as_str(),
|
||||
secrets.DIGITAL_OCEAN_SPACES_SECRET_ID.unwrap().as_str(),
|
||||
@@ -110,6 +112,8 @@ pub fn do_kubernetes_cluster_options(secrets: FuncTestsSecrets, cluster_name: St
|
||||
vpc_cidr_set: VpcInitKind::Autodetect,
|
||||
vpc_name: cluster_name,
|
||||
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(),
|
||||
qovery_engine_location: Some(EngineLocation::ClientSide),
|
||||
engine_version_controller_token: secrets.QOVERY_ENGINE_CONTROLLER_TOKEN.unwrap(),
|
||||
agent_version_controller_token: secrets.QOVERY_AGENT_CONTROLLER_TOKEN.unwrap(),
|
||||
|
||||
@@ -62,6 +62,7 @@ pub fn cloud_provider_scaleway(context: &Context) -> Scaleway {
|
||||
context.clone(),
|
||||
SCW_KUBE_TEST_CLUSTER_ID,
|
||||
SCW_QOVERY_ORGANIZATION_ID,
|
||||
uuid::Uuid::new_v4(),
|
||||
SCW_KUBE_TEST_CLUSTER_NAME,
|
||||
secrets
|
||||
.SCALEWAY_ACCESS_KEY
|
||||
@@ -90,6 +91,10 @@ pub fn cloud_provider_scaleway(context: &Context) -> Scaleway {
|
||||
pub fn scw_kubernetes_cluster_options(secrets: FuncTestsSecrets) -> KapsuleOptions {
|
||||
KapsuleOptions::new(
|
||||
secrets.QOVERY_API_URL.expect("QOVERY_API_URL is not set in secrets"),
|
||||
secrets.QOVERY_GRPC_URL.expect("QOVERY_GRPC_URL is not set in secrets"),
|
||||
secrets
|
||||
.QOVERY_CLUSTER_SECRET_TOKEN
|
||||
.expect("QOVERY_CLUSTER_SECRET_TOKEN is not set in secrets"),
|
||||
secrets.QOVERY_NATS_URL.expect("QOVERY_NATS_URL is not set in secrets"),
|
||||
secrets
|
||||
.QOVERY_NATS_USERNAME
|
||||
@@ -183,6 +188,7 @@ pub fn scw_kubernetes_kapsule<'a>(
|
||||
Kapsule::<'a>::new(
|
||||
context.clone(),
|
||||
SCW_KUBE_TEST_CLUSTER_ID.to_string(),
|
||||
uuid::Uuid::new_v4(),
|
||||
SCW_KUBE_TEST_CLUSTER_NAME.to_string(),
|
||||
SCW_KUBERNETES_VERSION.to_string(),
|
||||
zone,
|
||||
|
||||
@@ -121,6 +121,8 @@ pub struct FuncTestsSecrets {
|
||||
pub TERRAFORM_AWS_ACCESS_KEY_ID: Option<String>,
|
||||
pub TERRAFORM_AWS_SECRET_ACCESS_KEY: Option<String>,
|
||||
pub TERRAFORM_AWS_REGION: Option<String>,
|
||||
pub QOVERY_GRPC_URL: Option<String>,
|
||||
pub QOVERY_CLUSTER_SECRET_TOKEN: Option<String>,
|
||||
}
|
||||
|
||||
struct VaultConfig {
|
||||
@@ -197,6 +199,8 @@ impl FuncTestsSecrets {
|
||||
TERRAFORM_AWS_ACCESS_KEY_ID: None,
|
||||
TERRAFORM_AWS_SECRET_ACCESS_KEY: None,
|
||||
TERRAFORM_AWS_REGION: None,
|
||||
QOVERY_GRPC_URL: None,
|
||||
QOVERY_CLUSTER_SECRET_TOKEN: None,
|
||||
};
|
||||
|
||||
let vault_config = match Self::get_vault_config() {
|
||||
@@ -297,6 +301,11 @@ impl FuncTestsSecrets {
|
||||
secrets.TERRAFORM_AWS_SECRET_ACCESS_KEY,
|
||||
),
|
||||
TERRAFORM_AWS_REGION: Self::select_secret("TERRAFORM_AWS_REGION", secrets.TERRAFORM_AWS_REGION),
|
||||
QOVERY_GRPC_URL: Self::select_secret("QOVERY_GRPC_URL", secrets.QOVERY_GRPC_URL),
|
||||
QOVERY_CLUSTER_SECRET_TOKEN: Self::select_secret(
|
||||
"QOVERY_CLUSTER_SECRET_TOKEN",
|
||||
secrets.QOVERY_CLUSTER_SECRET_TOKEN,
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ fn create_upgrade_and_destroy_eks_cluster(
|
||||
let kubernetes = EKS::new(
|
||||
context.clone(),
|
||||
generate_cluster_id(region).as_str(),
|
||||
uuid::Uuid::new_v4(),
|
||||
generate_cluster_id(region).as_str(),
|
||||
boot_version,
|
||||
region,
|
||||
@@ -60,6 +61,7 @@ fn create_upgrade_and_destroy_eks_cluster(
|
||||
let kubernetes = EKS::new(
|
||||
context,
|
||||
generate_cluster_id(region).as_str(),
|
||||
uuid::Uuid::new_v4(),
|
||||
generate_cluster_id(region).as_str(),
|
||||
upgrade_to_version,
|
||||
region,
|
||||
@@ -120,6 +122,7 @@ fn create_and_destroy_eks_cluster(
|
||||
let kubernetes = EKS::new(
|
||||
context,
|
||||
generate_cluster_id(region).as_str(),
|
||||
uuid::Uuid::new_v4(),
|
||||
generate_cluster_id(region).as_str(),
|
||||
test_utilities::aws::AWS_KUBERNETES_VERSION,
|
||||
region,
|
||||
|
||||
@@ -39,6 +39,7 @@ fn create_upgrade_and_destroy_doks_cluster(
|
||||
let kubernetes = DOKS::new(
|
||||
context,
|
||||
cluster_id.clone(),
|
||||
uuid::Uuid::new_v4(),
|
||||
cluster_id.clone(),
|
||||
boot_version.to_string(),
|
||||
region,
|
||||
@@ -106,6 +107,7 @@ fn create_and_destroy_doks_cluster(region: Region, secrets: FuncTestsSecrets, te
|
||||
let kubernetes = DOKS::new(
|
||||
context,
|
||||
cluster_id.clone(),
|
||||
uuid::Uuid::new_v4(),
|
||||
cluster_id.clone(),
|
||||
DO_KUBERNETES_VERSION.to_string(),
|
||||
region,
|
||||
|
||||
@@ -37,6 +37,7 @@ fn create_digitalocean_kubernetes_doks_test_cluster() {
|
||||
let kubernetes = DOKS::new(
|
||||
context.clone(),
|
||||
test_utilities::digitalocean::DO_KUBE_TEST_CLUSTER_ID.to_string(),
|
||||
uuid::Uuid::new_v4(),
|
||||
test_utilities::digitalocean::DO_KUBE_TEST_CLUSTER_NAME.to_string(),
|
||||
test_utilities::digitalocean::DO_KUBERNETES_VERSION.to_string(),
|
||||
test_utilities::digitalocean::DO_TEST_REGION,
|
||||
@@ -92,6 +93,7 @@ fn destroy_digitalocean_kubernetes_doks_test_cluster() {
|
||||
let kubernetes = DOKS::new(
|
||||
context.clone(),
|
||||
test_utilities::digitalocean::DO_KUBE_TEST_CLUSTER_ID.to_string(),
|
||||
uuid::Uuid::new_v4(),
|
||||
test_utilities::digitalocean::DO_KUBE_TEST_CLUSTER_NAME.to_string(),
|
||||
test_utilities::digitalocean::DO_KUBERNETES_VERSION.to_string(),
|
||||
test_utilities::digitalocean::DO_TEST_REGION,
|
||||
|
||||
@@ -39,6 +39,7 @@ fn create_upgrade_and_destroy_kapsule_cluster(
|
||||
let kubernetes = Kapsule::new(
|
||||
context,
|
||||
cluster_id.clone(),
|
||||
uuid::Uuid::new_v4(),
|
||||
cluster_id,
|
||||
boot_version.to_string(),
|
||||
zone,
|
||||
@@ -106,6 +107,7 @@ fn create_and_destroy_kapsule_cluster(zone: Zone, secrets: FuncTestsSecrets, tes
|
||||
let kubernetes = Kapsule::new(
|
||||
context,
|
||||
cluster_id.clone(),
|
||||
uuid::Uuid::new_v4(),
|
||||
cluster_id,
|
||||
SCW_KUBERNETES_VERSION.to_string(),
|
||||
zone,
|
||||
|
||||
@@ -38,6 +38,7 @@ fn create_scaleway_kubernetes_kapsule_test_cluster() {
|
||||
let kubernetes = Kapsule::new(
|
||||
context.clone(),
|
||||
test_utilities::scaleway::SCW_KUBE_TEST_CLUSTER_ID.to_string(),
|
||||
uuid::Uuid::new_v4(),
|
||||
test_utilities::scaleway::SCW_KUBE_TEST_CLUSTER_NAME.to_string(),
|
||||
test_utilities::scaleway::SCW_KUBERNETES_VERSION.to_string(),
|
||||
test_utilities::scaleway::SCW_TEST_ZONE,
|
||||
@@ -90,6 +91,7 @@ fn destroy_scaleway_kubernetes_kapsule_test_cluster() {
|
||||
let kubernetes = Kapsule::new(
|
||||
context.clone(),
|
||||
test_utilities::scaleway::SCW_KUBE_TEST_CLUSTER_ID.to_string(),
|
||||
uuid::Uuid::new_v4(),
|
||||
test_utilities::scaleway::SCW_KUBE_TEST_CLUSTER_NAME.to_string(),
|
||||
test_utilities::scaleway::SCW_KUBERNETES_VERSION.to_string(),
|
||||
test_utilities::scaleway::SCW_TEST_ZONE,
|
||||
|
||||
Reference in New Issue
Block a user