The previous implementation blindly added HAProxy components without checking for existing configurations on the same port, which caused duplicate entries and errors when a service was updated. This commit refactors the logic to a robust "remove-then-add" strategy. The configure_service method now finds and removes any existing frontend and its dependent components (backend, servers, health check) before adding the new, complete service definition. This change makes the process fully idempotent, preventing configuration drift and ensuring a predictable state. Co-authored-by: Ian Letourneau <letourneau.ian@gmail.com> Reviewed-on: https://git.nationtech.io/NationTech/harmony/pulls/129
		
			
				
	
	
		
			80 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			TOML
		
	
	
	
	
	
			
		
		
	
	
			80 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			TOML
		
	
	
	
	
	
| [workspace]
 | |
| resolver = "2"
 | |
| members = [
 | |
|   "private_repos/*",
 | |
|   "examples/*",
 | |
|   "harmony",
 | |
|   "harmony_types",
 | |
|   "harmony_macros",
 | |
|   "harmony_tui",
 | |
|   "opnsense-config",
 | |
|   "opnsense-config-xml",
 | |
|   "harmony_cli",
 | |
|   "k3d",
 | |
|   "harmony_composer",
 | |
|   "harmony_inventory_agent",
 | |
|   "harmony_secret_derive",
 | |
|   "harmony_secret",
 | |
|   "adr/agent_discovery/mdns",
 | |
|   "brocade",
 | |
| ]
 | |
| 
 | |
| [workspace.package]
 | |
| version = "0.1.0"
 | |
| readme = "README.md"
 | |
| license = "GNU AGPL v3"
 | |
| 
 | |
| [workspace.dependencies]
 | |
| log = { version = "0.4", features = ["kv"] }
 | |
| env_logger = "0.11"
 | |
| derive-new = "0.7"
 | |
| async-trait = "0.1"
 | |
| tokio = { version = "1.40", features = [
 | |
|   "io-std",
 | |
|   "fs",
 | |
|   "macros",
 | |
|   "rt-multi-thread",
 | |
| ] }
 | |
| cidr = { features = ["serde"], version = "0.2" }
 | |
| russh = "0.45"
 | |
| russh-keys = "0.45"
 | |
| rand = "0.9"
 | |
| url = "2.5"
 | |
| kube = { version = "1.1.0", features = [
 | |
|   "config",
 | |
|   "client",
 | |
|   "runtime",
 | |
|   "rustls-tls",
 | |
|   "ws",
 | |
|   "jsonpatch",
 | |
| ] }
 | |
| k8s-openapi = { version = "0.25", features = ["v1_30"] }
 | |
| serde_yaml = "0.9"
 | |
| serde-value = "0.7"
 | |
| http = "1.2"
 | |
| inquire = "0.7"
 | |
| convert_case = "0.8"
 | |
| chrono = "0.4"
 | |
| similar = "2"
 | |
| uuid = { version = "1.11", features = ["v4", "fast-rng", "macro-diagnostics"] }
 | |
| pretty_assertions = "1.4.1"
 | |
| tempfile = "3.20.0"
 | |
| bollard = "0.19.1"
 | |
| base64 = "0.22.1"
 | |
| tar = "0.4.44"
 | |
| lazy_static = "1.5.0"
 | |
| directories = "6.0.0"
 | |
| thiserror = "2.0.14"
 | |
| serde = { version = "1.0.209", features = ["derive", "rc"] }
 | |
| serde_json = "1.0.127"
 | |
| askama = "0.14"
 | |
| sqlx = { version = "0.8", features = ["runtime-tokio", "sqlite"] }
 | |
| reqwest = { version = "0.12", features = [
 | |
|   "blocking",
 | |
|   "stream",
 | |
|   "rustls-tls",
 | |
|   "http2",
 | |
|   "json",
 | |
| ], default-features = false }
 | |
| assertor = "0.0.4"
 |