From 06277223e106501f8f47621e94013182c8341eea Mon Sep 17 00:00:00 2001 From: iGxnon Date: Mon, 23 Oct 2023 16:06:02 +0800 Subject: [PATCH] chore: naming stuff Signed-off-by: iGxnon --- Cargo.lock | 1 - operator-k8s/Cargo.toml | 1 - operator-k8s/src/manager/cluster.rs | 12 ++++++------ tests/e2e/cases/ci.sh | 4 ++-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 61860126..d5b47910 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3957,7 +3957,6 @@ dependencies = [ "axum", "clap 4.4.6", "clippy-utilities 0.2.0", - "event-listener", "flume", "futures", "garde", diff --git a/operator-k8s/Cargo.toml b/operator-k8s/Cargo.toml index b6c871ff..c7c05611 100644 --- a/operator-k8s/Cargo.toml +++ b/operator-k8s/Cargo.toml @@ -17,7 +17,6 @@ async-trait = "0.1.68" axum = "0.6.18" clap = { version = "4.3.4", features = ["derive"] } clippy-utilities = "0.2.0" -event-listener = "2.5.3" flume = "0.10.14" futures = "0.3.28" k8s-openapi = { version = "0.18.0", features = ["v1_26", "schemars"] } diff --git a/operator-k8s/src/manager/cluster.rs b/operator-k8s/src/manager/cluster.rs index f3150b2a..b3bfce45 100644 --- a/operator-k8s/src/manager/cluster.rs +++ b/operator-k8s/src/manager/cluster.rs @@ -41,8 +41,8 @@ impl Component { fn label(&self) -> &str { match *self { Component::Nodes => "nodes", - Component::Service => "srv", - Component::BackupJob => "job", + Component::Service => "svc", + Component::BackupJob => "backup", } } } @@ -307,12 +307,12 @@ impl Factory { let extractor = Extractor::new(self.cluster.as_ref()); let (name, namespace) = extractor.extract_id(); let (xline_port, _, _) = extractor.extract_ports(); - let srv_name = Self::component_name(name, Component::Service); + let svc_name = Self::component_name(name, Component::Service); let mut members = vec![]; for i in 0..=size { let node_name = format!("{}-{i}", Self::component_name(name, Component::Nodes)); members.push(format!( - "{node_name}={node_name}.{srv_name}.{namespace}.svc.{}:{}", + "{node_name}={node_name}.{svc_name}.{namespace}.svc.{}:{}", self.cluster_suffix, xline_port.container_port )); } @@ -622,11 +622,11 @@ spec: ); assert_eq!( Factory::component_name("my-xline-cluster", Component::Service), - "my-xline-cluster-srv" + "my-xline-cluster-svc" ); assert_eq!( Factory::component_name("my-xline-cluster", Component::BackupJob), - "my-xline-cluster-job" + "my-xline-cluster-backup" ); } diff --git a/tests/e2e/cases/ci.sh b/tests/e2e/cases/ci.sh index 9e303b83..857cfa9a 100644 --- a/tests/e2e/cases/ci.sh +++ b/tests/e2e/cases/ci.sh @@ -12,9 +12,9 @@ _TEST_CI_LOG_SYNC_TIMEOUT=30 _TEST_CI_START_SIZE=3 function test::ci::_mk_endpoints() { - local endpoints="${_TEST_CI_CLUSTER_NAME}-nodes-0.${_TEST_CI_CLUSTER_NAME}-srv.${_TEST_CI_NAMESPACE}.svc.${_TEST_CI_DNS_SUFFIX}:${_TEST_CI_XLINE_PORT}" + local endpoints="${_TEST_CI_CLUSTER_NAME}-nodes-0.${_TEST_CI_CLUSTER_NAME}-svc.${_TEST_CI_NAMESPACE}.svc.${_TEST_CI_DNS_SUFFIX}:${_TEST_CI_XLINE_PORT}" for ((i = 1; i < $1; i++)); do - endpoints="${endpoints},${_TEST_CI_CLUSTER_NAME}-nodes-${i}.${_TEST_CI_CLUSTER_NAME}-srv.${_TEST_CI_NAMESPACE}.svc.${_TEST_CI_DNS_SUFFIX}:${_TEST_CI_XLINE_PORT}" + endpoints="${endpoints},${_TEST_CI_CLUSTER_NAME}-nodes-${i}.${_TEST_CI_CLUSTER_NAME}-svc.${_TEST_CI_NAMESPACE}.svc.${_TEST_CI_DNS_SUFFIX}:${_TEST_CI_XLINE_PORT}" done echo "$endpoints" }