Add variable reference to container env

This commit is contained in:
Jingfang Liu
2018-06-14 13:38:58 -07:00
parent 54ac4e73e7
commit 09ab2bb5c0
3 changed files with 22 additions and 2 deletions

View File

@@ -89,7 +89,7 @@ The patch has following content
> - name: wordpress
> env:
> - name: WORDPRESS_DB_HOST
> value: mysql
> value: $(MYSQL_SERVICE)
> - name: WORDPRESS_DB_PASSWORD
> valueFrom:
> secretKeyRef:

View File

@@ -15,7 +15,7 @@ spec:
- name: wordpress
env:
- name: WORDPRESS_DB_HOST
value: mysql
value: $(MYSQL_SERVICE)
- name: WORDPRESS_DB_PASSWORD
valueFrom:
secretKeyRef:

View File

@@ -58,6 +58,26 @@ func NewRefVarTransformer(vars map[string]string) (Transformer, error) {
GroupVersionKind: &schema.GroupVersionKind{Kind: "Job"},
Path: []string{"spec", "template", "spec", "containers", "args"},
},
{
GroupVersionKind: &schema.GroupVersionKind{Kind: "StatefulSet"},
Path: []string{"spec", "template", "spec", "initContainers", "env", "value"},
},
{
GroupVersionKind: &schema.GroupVersionKind{Kind: "StatefulSet"},
Path: []string{"spec", "template", "spec", "containers", "env", "value"},
},
{
GroupVersionKind: &schema.GroupVersionKind{Kind: "Deployment"},
Path: []string{"spec", "template", "spec", "initContainers", "env", "value"},
},
{
GroupVersionKind: &schema.GroupVersionKind{Kind: "Deployment"},
Path: []string{"spec", "template", "spec", "containers", "env", "value"},
},
{
GroupVersionKind: &schema.GroupVersionKind{Kind: "Job"},
Path: []string{"spec", "template", "spec", "containers", "env", "value"},
},
},
}, nil
}