diff --git a/base/deploy.k b/base/deploy.k index 928c913..637febb 100644 --- a/base/deploy.k +++ b/base/deploy.k @@ -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}] } ] diff --git a/base/env.k b/base/env.k index 116fe04..235df40 100644 --- a/base/env.k +++ b/base/env.k @@ -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 = { diff --git a/main.k b/main.k index 3897cb1..3e22a71 100644 --- a/main.k +++ b/main.k @@ -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 } ]