use crate::types::*;

pub fn test_network() -> ErgoNetwork {
    ErgoNetwork {
        metadata: kube::api::ObjectMeta {
            name: Some("test-network".to_string()),
            namespace: Some("test-ns".to_string()),
            uid: Some("test-uid".to_string()),
            ..Default::default()
        },
        spec: ErgoNetworkSpec {
            hostname: "test-network.irc.now".to_string(),
            network_name: Some("Test Network".to_string()),
            oper_credentials: Some(OperCredentials {
                secret_name: "test-network-oper".to_string(),
            }),
            listeners: vec![
                Listener {
                    address: ":6697".to_string(),
                    tls: true,
                },
                Listener {
                    address: ":6667".to_string(),
                    tls: false,
                },
            ],
            tls: Some(TlsSpec {
                issuer_ref: IssuerRef {
                    name: "letsencrypt-prod".to_string(),
                    kind: "ClusterIssuer".to_string(),
                },
                dns_names: vec!["test-network.irc.now".to_string()],
            }),
            route: Some(RouteSpec {
                host: "test-network.irc.now".to_string(),
            }),
            resources: Some(ResourceRequirements {
                requests: Some(ResourceList {
                    memory: Some("64Mi".to_string()),
                    cpu: Some("50m".to_string()),
                }),
                limits: Some(ResourceList {
                    memory: Some("256Mi".to_string()),
                    cpu: Some("200m".to_string()),
                }),
            }),
            storage: Some(StorageSpec {
                size: "1Gi".to_string(),
                storage_class_name: Some("customer-workload-storage".to_string()),
            }),
        },
        status: None,
    }
}
