feat(homelab): start adding route kind

This commit is contained in:
2025-12-28 22:15:11 -08:00
parent 0993820675
commit f89a7e1813

View File

@@ -4,6 +4,7 @@ use crate::{Config, HelperError};
#[derive(Serialize, Deserialize, Default)]
pub struct Route {
kind: RouteKind,
name: String,
hostname: String,
namespace: String,
@@ -12,6 +13,11 @@ pub struct Route {
private: bool,
}
enum RouteKind {
HTTP,
TCP,
}
pub fn generate_routes(config: &Config) -> Result<(), HelperError> {
let routes = config
.routes
@@ -45,7 +51,7 @@ fn generate_route(route: &Route) -> String {
format!(
r#"apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
kind: {}
metadata:
name: {}
namespace: {}