Update image references for nginx and caddy, and enhance environment injection for deployments

This commit is contained in:
2025-03-14 18:15:11 +08:00
parent a890a979e9
commit 6edd214baf
3 changed files with 8 additions and 7 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ appRender = lambda a: App {
template.spec.containers = [
{
name = a.name
image = a.image
image = "cr.suyiiyii.top/docker.io" + a.image
ports = [{containerPort = a.port}]
}
]
+5 -4
View File
@@ -17,12 +17,13 @@ envSecretRender = lambda e: Envs {
[secret]
}
envInjector = lambda envs: Envs, deploy {
envInjector = lambda envs: Envs, input: appsv1.Deployment | any {
"""Inject envs to Deployment"""
_result = {}
if deploy.kind != "Deployment":
_result = deploy
_result: any = {}
if input.kind != "Deployment":
input
else:
deploy: appsv1.Deployment = input as appsv1.Deployment
secretEnv: [corev1.EnvVar] = [{
name = k
valueFrom = {
+2 -2
View File
@@ -6,13 +6,13 @@ apps = [
base.App {
name = "nginxxx"
replicas = 2
image = "nginx"
image = "library/nginx"
port = 80
}
base.App {
name = "caddyy"
replicas = 2
image = "caddy"
image = "library/caddy"
port = 80
}
]