feat ctx: Let sub-resource-sets inherit vars from parent
Users of kontemplate may expect variables defined on the parent resource to be inherited by children. This implements that functionality. Values defined twice are overwritten by the child's definition. Fixes #20
This commit is contained in:
		
							parent
							
								
									f81fe551bc
								
							
						
					
					
						commit
						0147c3e13e
					
				
					 4 changed files with 81 additions and 0 deletions
				
			
		
							
								
								
									
										10
									
								
								context/testdata/parent-variable-override.yaml
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								context/testdata/parent-variable-override.yaml
									
										
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,10 @@ | |||
| --- | ||||
| context: k8s.prod.mydomain.com | ||||
| include: | ||||
|   - name: parent | ||||
|     values: | ||||
|       foo: bar | ||||
|     include: | ||||
|       - name: child | ||||
|         values: | ||||
|           foo: newvalue | ||||
							
								
								
									
										10
									
								
								context/testdata/parent-variables.yaml
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								context/testdata/parent-variables.yaml
									
										
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,10 @@ | |||
| --- | ||||
| context: k8s.prod.mydomain.com | ||||
| include: | ||||
|   - name: parent | ||||
|     values: | ||||
|       foo: bar | ||||
|     include: | ||||
|       - name: child | ||||
|         values: | ||||
|           bar: baz | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue