Update image references for nginx and caddy, and enhance environment injection for deployments
This commit is contained in:
		
							parent
							
								
									a890a979e9
								
							
						
					
					
						commit
						6edd214baf
					
				@ -24,7 +24,7 @@ appRender = lambda a: App {
 | 
				
			|||||||
            template.spec.containers = [
 | 
					            template.spec.containers = [
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    name = a.name
 | 
					                    name = a.name
 | 
				
			||||||
                    image = a.image
 | 
					                    image = "cr.suyiiyii.top/docker.io" + a.image
 | 
				
			||||||
                    ports = [{containerPort = a.port}]
 | 
					                    ports = [{containerPort = a.port}]
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            ]
 | 
					            ]
 | 
				
			||||||
 | 
				
			|||||||
@ -17,12 +17,13 @@ envSecretRender = lambda e: Envs {
 | 
				
			|||||||
    [secret]
 | 
					    [secret]
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
envInjector = lambda envs: Envs, deploy {
 | 
					envInjector = lambda envs: Envs, input: appsv1.Deployment | any {
 | 
				
			||||||
    """Inject envs to Deployment"""
 | 
					    """Inject envs to Deployment"""
 | 
				
			||||||
    _result = {}
 | 
					    _result: any = {}
 | 
				
			||||||
    if deploy.kind != "Deployment":
 | 
					    if input.kind != "Deployment":
 | 
				
			||||||
        _result = deploy
 | 
					        input
 | 
				
			||||||
    else:
 | 
					    else:
 | 
				
			||||||
 | 
					        deploy: appsv1.Deployment = input as appsv1.Deployment
 | 
				
			||||||
        secretEnv: [corev1.EnvVar] = [{
 | 
					        secretEnv: [corev1.EnvVar] = [{
 | 
				
			||||||
            name = k
 | 
					            name = k
 | 
				
			||||||
            valueFrom = {
 | 
					            valueFrom = {
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										4
									
								
								main.k
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								main.k
									
									
									
									
									
								
							@ -6,13 +6,13 @@ apps = [
 | 
				
			|||||||
    base.App {
 | 
					    base.App {
 | 
				
			||||||
        name = "nginxxx"
 | 
					        name = "nginxxx"
 | 
				
			||||||
        replicas = 2
 | 
					        replicas = 2
 | 
				
			||||||
        image = "nginx"
 | 
					        image = "library/nginx"
 | 
				
			||||||
        port = 80
 | 
					        port = 80
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    base.App {
 | 
					    base.App {
 | 
				
			||||||
        name = "caddyy"
 | 
					        name = "caddyy"
 | 
				
			||||||
        replicas = 2
 | 
					        replicas = 2
 | 
				
			||||||
        image = "caddy"
 | 
					        image = "library/caddy"
 | 
				
			||||||
        port = 80
 | 
					        port = 80
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user