Skip to content

Commit

Permalink
chore: naming stuff
Browse files Browse the repository at this point in the history
Signed-off-by: iGxnon <[email protected]>
  • Loading branch information
iGxnon authored and mergify[bot] committed Oct 25, 2023
1 parent 7ca4d4c commit 0627722
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion operator-k8s/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
12 changes: 6 additions & 6 deletions operator-k8s/src/manager/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
}
}
Expand Down Expand Up @@ -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
));
}
Expand Down Expand Up @@ -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"
);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/cases/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit 0627722

Please sign in to comment.