feat: remove nesting
Some checks reported errors
continuous-integration/drone/push Build encountered an error

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2024-05-27 22:50:51 +02:00
parent 22319ce56d
commit ef737418c3
Signed by: kjuulh
GPG Key ID: 9AA7BC13CE474394
4 changed files with 32 additions and 29 deletions

12
Cargo.lock generated
View File

@ -906,9 +906,9 @@ dependencies = [
[[package]] [[package]]
name = "clang-sys" name = "clang-sys"
version = "1.7.0" version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" checksum = "a483f3cbf7cec2e153d424d0e92329d816becc6421389bd494375c6065921b9b"
dependencies = [ dependencies = [
"glob", "glob",
"libc", "libc",
@ -1040,9 +1040,9 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5"
[[package]] [[package]]
name = "crc32c" name = "crc32c"
version = "0.6.5" version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89254598aa9b9fa608de44b3ae54c810f0f06d755e24c50177f1f8f31ff50ce2" checksum = "716b38bb6e49e9071060ab2c5e26195b70274f83fdf6cbc44542d63bb2f45c7d"
dependencies = [ dependencies = [
"rustc_version", "rustc_version",
] ]
@ -1136,7 +1136,7 @@ dependencies = [
[[package]] [[package]]
name = "cuddle-clusters" name = "cuddle-clusters"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.front.kjuulh.io/kjuulh/cuddle-clusters?branch=main#f24f2706ae3d6218e1eedf52191674eab468ba94" source = "git+https://git.front.kjuulh.io/kjuulh/cuddle-clusters?branch=main#c08dcb049d39e0d363a6c102b59d620f82acdc1a"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@ -1615,7 +1615,7 @@ dependencies = [
[[package]] [[package]]
name = "flux-releaser" name = "flux-releaser"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.front.kjuulh.io/kjuulh/flux-releaser?branch=main#3ca0a836ca9382dfc53ecc159a7ddc10e08e6755" source = "git+https://git.front.kjuulh.io/kjuulh/flux-releaser?branch=main#44ae9c2d2b1fbf418d2894e9a608671ecac6f187"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",

View File

@ -2,7 +2,7 @@ use std::collections::HashMap;
use std::path::PathBuf; use std::path::PathBuf;
use async_trait::async_trait; use async_trait::async_trait;
use cuddle_ci::cuddle_file::{self, CuddleFile}; use cuddle_ci::cuddle_file::CuddleFile;
use cuddle_ci::cuddle_releaser::CuddleReleaser; use cuddle_ci::cuddle_releaser::CuddleReleaser;
use cuddle_ci::rust_service::architecture::{Architecture, Os}; use cuddle_ci::rust_service::architecture::{Architecture, Os};
use cuddle_ci::rust_service::RustService; use cuddle_ci::rust_service::RustService;
@ -11,6 +11,7 @@ use cuddle_ci::{Context, CuddleCI, MainAction, PullRequestAction};
use cuddle_clusters::catalog::cluster_vars::ClusterVars; use cuddle_clusters::catalog::cluster_vars::ClusterVars;
use cuddle_clusters::catalog::crdb_database::CockroachDB; use cuddle_clusters::catalog::crdb_database::CockroachDB;
use cuddle_clusters::catalog::cuddle_vars::CuddleVars; use cuddle_clusters::catalog::cuddle_vars::CuddleVars;
use cuddle_clusters::catalog::ingress::Ingress;
use cuddle_clusters::catalog::vault_secret::VaultSecret; use cuddle_clusters::catalog::vault_secret::VaultSecret;
use cuddle_clusters::releaser::Releaser; use cuddle_clusters::releaser::Releaser;
use cuddle_clusters::IntoComponent; use cuddle_clusters::IntoComponent;
@ -81,6 +82,10 @@ impl RustServiceRender {
.await .await
.map_err(|e| eyre::anyhow!("failed to get cuddle vars: {}", e.to_string()))? .map_err(|e| eyre::anyhow!("failed to get cuddle vars: {}", e.to_string()))?
.into_component(), .into_component(),
Ingress::new(&std::env::current_dir()?)
.await
.map_err(|e| eyre::anyhow!("failed to get cuddle vars: {}", e.to_string()))?
.into_component(),
], ],
cuddle_clusters::process::ProcessOpts { cuddle_clusters::process::ProcessOpts {
path: std::env::current_dir()?, path: std::env::current_dir()?,

View File

@ -7,8 +7,7 @@ metadata:
namespace: {{ cluster_namespace }} namespace: {{ cluster_namespace }}
data: data:
{%- if (vars.cluster_vars.env | items | length) > 0 %} {%- if (vars.cluster_vars.env | items | length) > 0 %}
environment:
{%- for (name, value) in vars.cluster_vars.env | dictsort %} {%- for (name, value) in vars.cluster_vars.env | dictsort %}
{{name | upper | replace(".", "_") | replace("-", "_") }}: {{value}} {{name | upper | replace(".", "_") | replace("-", "_") }}: {{value}}
{%- endfor %} {%- endfor %}
{%- endif %} {%- endif %}

View File

@ -1,26 +1,25 @@
{%- set service_name = vars.cuddle_vars.service -%}
{%- set cluster_name = vars.cluster_vars.name -%}
{%- set cluster_namespace = vars.cluster_vars.namespace -%}
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
labels: name: "{{ service_name }}"
app: {{ vars.cuddle_vars.service }} namespace: {{ cluster_namespace }}
cluster: {{ environment }}
name: {{ vars.cuddle_vars.service }}
namespace: {{ vars.cluster_vars.namespace }}
spec: spec:
ports:
- name: external-http
port: 3000
targetPort: 3000
- name: internal-http
port: 3001
targetPort: 3001
- name: internal-grpc
port: 3002
targetPort: 3002
- name: external-grpc
port: 7900
targetPort: 7900
selector: selector:
app: {{ vars.cuddle_vars.service }} app: {{ service_name }}
cluster: {{ environment }} cluster: {{ cluster_name }}
type: LoadBalancer type: LoadBalancer
ports:
- name: external-http
port: 3000
targetPort: 3000
- name: internal-http
port: 3001
targetPort: 3001
- name: internal-grpc
port: 3002
targetPort: 3002