-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(k8s): allow null in spec.files for deploy config (#4881)
* fix(k8s): allow null in spec.files for deploy config * chore: add tests and use helper isTruthy
- Loading branch information
1 parent
05d0f44
commit 4fc3a09
Showing
6 changed files
with
73 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
.../test/data/test-projects/kubernetes-type-conditional-manifests/config.map-list/garden.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
kind: "Deploy" | ||
type: "kubernetes" | ||
name: "config-map-list" | ||
variables: | ||
foo: false | ||
spec: | ||
files: | ||
- "${var.foo ? 'manifests.yaml' : null}" |
21 changes: 21 additions & 0 deletions
21
...t/data/test-projects/kubernetes-type-conditional-manifests/config.map-list/manifests.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: v1 | ||
items: | ||
- apiVersion: v1 | ||
data: | ||
foo.json: test | ||
kind: ConfigMap | ||
metadata: | ||
name: foo | ||
- apiVersion: v1 | ||
data: | ||
bar.json: test | ||
kind: ConfigMap | ||
metadata: | ||
name: bar | ||
- apiVersion: v1 | ||
data: | ||
baz.json: test | ||
kind: ConfigMap | ||
metadata: | ||
name: baz | ||
kind: ConfigMapList |
7 changes: 7 additions & 0 deletions
7
core/test/data/test-projects/kubernetes-type-conditional-manifests/garden.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: garden.io/v1 | ||
kind: Project | ||
name: test-kubernetes-type-conditional-manifests | ||
environments: | ||
- name: local | ||
providers: | ||
- name: local-kubernetes |
36 changes: 18 additions & 18 deletions
36
core/test/data/test-projects/kubernetes-type/config-map-list/manifests.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
apiVersion: v1 | ||
items: | ||
- apiVersion: v1 | ||
data: | ||
foo.json: test | ||
kind: ConfigMap | ||
metadata: | ||
name: foo | ||
- apiVersion: v1 | ||
data: | ||
bar.json: test | ||
kind: ConfigMap | ||
metadata: | ||
name: bar | ||
- apiVersion: v1 | ||
data: | ||
baz.json: test | ||
kind: ConfigMap | ||
metadata: | ||
name: baz | ||
- apiVersion: v1 | ||
data: | ||
foo.json: test | ||
kind: ConfigMap | ||
metadata: | ||
name: foo | ||
- apiVersion: v1 | ||
data: | ||
bar.json: test | ||
kind: ConfigMap | ||
metadata: | ||
name: bar | ||
- apiVersion: v1 | ||
data: | ||
baz.json: test | ||
kind: ConfigMap | ||
metadata: | ||
name: baz | ||
kind: ConfigMapList |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters