From e016929f7ec31cceb1dd527a8d48d4361a9369c7 Mon Sep 17 00:00:00 2001 From: paulobressan Date: Wed, 13 Nov 2024 10:55:21 -0300 Subject: [PATCH 1/2] feat: allowed auth token in spec --- operator/src/controller.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/operator/src/controller.rs b/operator/src/controller.rs index 405d9e3..3ed1607 100644 --- a/operator/src/controller.rs +++ b/operator/src/controller.rs @@ -45,6 +45,7 @@ pub struct ScrollsPortSpec { pub network: String, pub throughput_tier: String, pub version: String, + pub auth_token: Option, } #[derive(Deserialize, Serialize, Clone, Default, Debug, JsonSchema)] @@ -56,7 +57,11 @@ pub struct ScrollsPortStatus { } async fn reconcile(crd: Arc, ctx: Arc) -> Result { - let key = build_api_key(&crd).await?; + let key = match &crd.spec.auth_token { + Some(key) => key.clone(), + None => build_api_key(&crd).await?, + }; + let (hostname, hostname_key) = build_hostname(&key); let status = ScrollsPortStatus { From 0b82fbb213122dd6142f8e75ffb6ba2f92f0fafd Mon Sep 17 00:00:00 2001 From: paulobressan Date: Wed, 13 Nov 2024 11:29:09 -0300 Subject: [PATCH 2/2] chore(bootstrap): updated crds spec --- bootstrap/crds/main.tf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bootstrap/crds/main.tf b/bootstrap/crds/main.tf index f06f796..ae3f75c 100644 --- a/bootstrap/crds/main.tf +++ b/bootstrap/crds/main.tf @@ -55,6 +55,10 @@ resource "kubernetes_manifest" "customresourcedefinition_scrollsports_demeter_ru "properties" = { "spec" = { "properties" = { + "authToken" = { + "nullable" = true + "type" = "string" + } "network" = { "type" = "string" }