-
Notifications
You must be signed in to change notification settings - Fork 0
/
services.tftest.hcl
47 lines (39 loc) · 1.33 KB
/
services.tftest.hcl
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
variables {
ingress_enabled = false
service_enabled = true
app_name = "some-app"
namespace = "some-namespace"
app_docker_image = "busybox"
readiness_probe_enabled = false
liveness_probe_enabled = false
service_port = 123
container_port = 321
service_type = "NodePort"
}
run "it creates service for app in k8s" {
command = plan
assert {
condition = kubernetes_service.main[0].metadata[0].name == "some-app"
error_message = "Service name was not passed correctly"
}
assert {
condition = kubernetes_service.main[0].metadata[0].namespace == "some-namespace"
error_message = "Service namespace was not passed correctly"
}
assert {
condition = kubernetes_service.main[0].spec[0].selector.app == "some-app"
error_message = "Service selector was not passed correctly"
}
assert {
condition = kubernetes_service.main[0].spec[0].port[0].port == 123
error_message = "Service port was not passed correctly"
}
assert {
condition = kubernetes_service.main[0].spec[0].port[0].target_port == "321"
error_message = "Service target port was not passed correctly"
}
assert {
condition = kubernetes_service.main[0].spec[0].type == "NodePort"
error_message = "Service type was not passed correctly"
}
}