-
Notifications
You must be signed in to change notification settings - Fork 53
/
test.tf
50 lines (41 loc) · 1.07 KB
/
test.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
terraform {
required_providers {
kustomization = {
source = "kbst/kustomization"
# all test versions are placed as 1.0.0
# in .terraform/plugins for tests
version = ">= 1.0.0"
}
}
required_version = ">= 0.13"
}
data "kustomization_build" "test" {
path = "kustomize/test_kustomizations/basic/initial"
}
resource "kustomization_resource" "from_build" {
for_each = data.kustomization_build.test.ids
manifest = data.kustomization_build.test.manifests[each.value]
}
data "kustomization_overlay" "test" {
namespace = "test-overlay"
resources = [
"kustomize/test_kustomizations/basic/initial"
]
patches {
patch = <<-EOF
- op: add
path: /spec/template/spec/containers/0/env
value: [{"name": "TEST", "value": "true"}]
EOF
target {
group = "apps"
version = "v1"
kind = "Deployment"
name = "test"
}
}
}
resource "kustomization_resource" "from_overlay" {
for_each = data.kustomization_overlay.test.ids
manifest = data.kustomization_overlay.test.manifests[each.value]
}