Skip to content

Commit 09ab2bb

Browse files
committed
Add variable reference to container env
1 parent 54ac4e7 commit 09ab2bb

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

examples/wordpress/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ The patch has following content
8989
> - name: wordpress
9090
> env:
9191
> - name: WORDPRESS_DB_HOST
92-
> value: mysql
92+
> value: $(MYSQL_SERVICE)
9393
> - name: WORDPRESS_DB_PASSWORD
9494
> valueFrom:
9595
> secretKeyRef:

examples/wordpress/patch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
- name: wordpress
1616
env:
1717
- name: WORDPRESS_DB_HOST
18-
value: mysql
18+
value: $(MYSQL_SERVICE)
1919
- name: WORDPRESS_DB_PASSWORD
2020
valueFrom:
2121
secretKeyRef:

pkg/transformers/refvars.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,26 @@ func NewRefVarTransformer(vars map[string]string) (Transformer, error) {
5858
GroupVersionKind: &schema.GroupVersionKind{Kind: "Job"},
5959
Path: []string{"spec", "template", "spec", "containers", "args"},
6060
},
61+
{
62+
GroupVersionKind: &schema.GroupVersionKind{Kind: "StatefulSet"},
63+
Path: []string{"spec", "template", "spec", "initContainers", "env", "value"},
64+
},
65+
{
66+
GroupVersionKind: &schema.GroupVersionKind{Kind: "StatefulSet"},
67+
Path: []string{"spec", "template", "spec", "containers", "env", "value"},
68+
},
69+
{
70+
GroupVersionKind: &schema.GroupVersionKind{Kind: "Deployment"},
71+
Path: []string{"spec", "template", "spec", "initContainers", "env", "value"},
72+
},
73+
{
74+
GroupVersionKind: &schema.GroupVersionKind{Kind: "Deployment"},
75+
Path: []string{"spec", "template", "spec", "containers", "env", "value"},
76+
},
77+
{
78+
GroupVersionKind: &schema.GroupVersionKind{Kind: "Job"},
79+
Path: []string{"spec", "template", "spec", "containers", "env", "value"},
80+
},
6181
},
6282
}, nil
6383
}

0 commit comments

Comments
 (0)