feat(homelab): start adding route kind
This commit is contained in:
@@ -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: {}
|
||||
|
||||
Reference in New Issue
Block a user