fix(k8s_anywhere): Ensure k3d cluster is started before use

- Refactor k3d cluster management to explicitly start the cluster.
- Introduce `start_cluster` function to ensure cluster is running before operations.
- Improve error handling and logging during cluster startup.
- Update `create_cluster` and other related functions to utilize the new startup mechanism.
- Enhance reliability and prevent potential issues caused by an uninitialized cluster.
- Add `run_k3d_command` to handle k3d commands with logging and error handling.
This commit is contained in:
2025-04-25 11:32:02 -04:00
parent 23971ecd7c
commit 22752960f9
5 changed files with 81 additions and 30 deletions

View File

@@ -23,7 +23,7 @@ pub struct Config {
}
impl Serialize for Config {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
fn serialize<S>(&self, _serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{

View File

@@ -10,11 +10,11 @@ mod test {
use std::net::Ipv4Addr;
use crate::Config;
use pretty_assertions::assert_eq;
#[cfg(opnsenseendtoend)]
#[tokio::test]
async fn test_public_sdk() {
use pretty_assertions::assert_eq;
let mac = "11:22:33:44:55:66";
let ip = Ipv4Addr::new(10, 100, 8, 200);
let hostname = "test_hostname";