diff --git a/.gitignore b/.gitignore index 915c4fc8..a1913e40 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file +Dockerfile diff --git a/Cargo.lock b/Cargo.lock index ad03750f..916cdf2d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3230,6 +3230,7 @@ dependencies = [ "time 0.2.27", "tracing", "tracing-subscriber", + "uuid 0.8.2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index ffbef80d..11008d6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 diff --git a/src/cloud_provider/aws/kubernetes/helm_charts.rs b/src/cloud_provider/aws/kubernetes/helm_charts.rs index 48c51ce4..aa369f05 100644 --- a/src/cloud_provider/aws/kubernetes/helm_charts.rs +++ b/src/cloud_provider/aws/kubernetes/helm_charts.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(), diff --git a/src/cloud_provider/aws/kubernetes/mod.rs b/src/cloud_provider/aws/kubernetes/mod.rs index a99700ff..53bb5f3c 100644 --- a/src/cloud_provider/aws/kubernetes/mod.rs +++ b/src/cloud_provider/aws/kubernetes/mod.rs @@ -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, 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(), diff --git a/src/cloud_provider/aws/mod.rs b/src/cloud_provider/aws/mod.rs index 978652c0..273404d3 100644 --- a/src/cloud_provider/aws/mod.rs +++ b/src/cloud_provider/aws/mod.rs @@ -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(), diff --git a/src/cloud_provider/digitalocean/kubernetes/helm_charts.rs b/src/cloud_provider/digitalocean/kubernetes/helm_charts.rs index e1d947c5..c0819758 100644 --- a/src/cloud_provider/digitalocean/kubernetes/helm_charts.rs +++ b/src/cloud_provider/digitalocean/kubernetes/helm_charts.rs @@ -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(), diff --git a/src/cloud_provider/digitalocean/kubernetes/mod.rs b/src/cloud_provider/digitalocean/kubernetes/mod.rs index ea8ed821..b960ae71 100644 --- a/src/cloud_provider/digitalocean/kubernetes/mod.rs +++ b/src/cloud_provider/digitalocean/kubernetes/mod.rs @@ -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, 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(), diff --git a/src/cloud_provider/digitalocean/mod.rs b/src/cloud_provider/digitalocean/mod.rs index 72501218..b4c4062f 100644 --- a/src/cloud_provider/digitalocean/mod.rs +++ b/src/cloud_provider/digitalocean/mod.rs @@ -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(), diff --git a/src/cloud_provider/scaleway/kubernetes/helm_charts.rs b/src/cloud_provider/scaleway/kubernetes/helm_charts.rs index 353ccd6e..dac9d387 100644 --- a/src/cloud_provider/scaleway/kubernetes/helm_charts.rs +++ b/src/cloud_provider/scaleway/kubernetes/helm_charts.rs @@ -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(), diff --git a/src/cloud_provider/scaleway/kubernetes/mod.rs b/src/cloud_provider/scaleway/kubernetes/mod.rs index 0fe62b02..dceb5918 100644 --- a/src/cloud_provider/scaleway/kubernetes/mod.rs +++ b/src/cloud_provider/scaleway/kubernetes/mod.rs @@ -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(), diff --git a/src/cloud_provider/scaleway/mod.rs b/src/cloud_provider/scaleway/mod.rs index 19a181af..17b90146 100644 --- a/src/cloud_provider/scaleway/mod.rs +++ b/src/cloud_provider/scaleway/mod.rs @@ -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(), diff --git a/test_utilities/Cargo.lock b/test_utilities/Cargo.lock index 70470b58..a2893062 100644 --- a/test_utilities/Cargo.lock +++ b/test_utilities/Cargo.lock @@ -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" diff --git a/test_utilities/Cargo.toml b/test_utilities/Cargo.toml index 2a76c711..34e26768 100644 --- a/test_utilities/Cargo.toml +++ b/test_utilities/Cargo.toml @@ -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" diff --git a/test_utilities/src/aws.rs b/test_utilities/src/aws.rs index 604dbddf..0e91b3eb 100644 --- a/test_utilities/src/aws.rs +++ b/test_utilities/src/aws.rs @@ -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(), diff --git a/test_utilities/src/digitalocean.rs b/test_utilities/src/digitalocean.rs index 615d2b2c..aa459b12 100644 --- a/test_utilities/src/digitalocean.rs +++ b/test_utilities/src/digitalocean.rs @@ -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(), diff --git a/test_utilities/src/scaleway.rs b/test_utilities/src/scaleway.rs index 5291367d..56cbccbc 100644 --- a/test_utilities/src/scaleway.rs +++ b/test_utilities/src/scaleway.rs @@ -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, diff --git a/test_utilities/src/utilities.rs b/test_utilities/src/utilities.rs index 569b8592..bacf2aee 100644 --- a/test_utilities/src/utilities.rs +++ b/test_utilities/src/utilities.rs @@ -121,6 +121,8 @@ pub struct FuncTestsSecrets { pub TERRAFORM_AWS_ACCESS_KEY_ID: Option, pub TERRAFORM_AWS_SECRET_ACCESS_KEY: Option, pub TERRAFORM_AWS_REGION: Option, + pub QOVERY_GRPC_URL: Option, + pub QOVERY_CLUSTER_SECRET_TOKEN: Option, } 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, + ), } } } diff --git a/tests/aws/aws_kubernetes.rs b/tests/aws/aws_kubernetes.rs index 2603d180..7c91c513 100644 --- a/tests/aws/aws_kubernetes.rs +++ b/tests/aws/aws_kubernetes.rs @@ -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, diff --git a/tests/digitalocean/do_kubernetes.rs b/tests/digitalocean/do_kubernetes.rs index 89f0eeec..cb672c1b 100644 --- a/tests/digitalocean/do_kubernetes.rs +++ b/tests/digitalocean/do_kubernetes.rs @@ -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, diff --git a/tests/digitalocean/do_utility_kubernetes_doks_test_cluster.rs b/tests/digitalocean/do_utility_kubernetes_doks_test_cluster.rs index eecbaa88..832ba7f8 100644 --- a/tests/digitalocean/do_utility_kubernetes_doks_test_cluster.rs +++ b/tests/digitalocean/do_utility_kubernetes_doks_test_cluster.rs @@ -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, diff --git a/tests/scaleway/scw_kubernetes.rs b/tests/scaleway/scw_kubernetes.rs index 58336a84..395064ad 100644 --- a/tests/scaleway/scw_kubernetes.rs +++ b/tests/scaleway/scw_kubernetes.rs @@ -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, diff --git a/tests/scaleway/scw_utility_kubernetes_kapsule_test_cluster.rs b/tests/scaleway/scw_utility_kubernetes_kapsule_test_cluster.rs index e2df1620..82ee1d25 100644 --- a/tests/scaleway/scw_utility_kubernetes_kapsule_test_cluster.rs +++ b/tests/scaleway/scw_utility_kubernetes_kapsule_test_cluster.rs @@ -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,