137 lines
3.7 KiB
YAML
137 lines
3.7 KiB
YAML
suite: "Controller Deployment args"
|
|
templates:
|
|
- deployment.yaml
|
|
tests:
|
|
- it: should include metrics-disabled flags by default
|
|
release:
|
|
name: "test-arc"
|
|
namespace: "test-ns"
|
|
asserts:
|
|
- contains:
|
|
path: spec.template.spec.containers[0].args
|
|
content: "--metrics-addr=0"
|
|
- contains:
|
|
path: spec.template.spec.containers[0].args
|
|
content: "--listener-metrics-addr=0"
|
|
- contains:
|
|
path: spec.template.spec.containers[0].args
|
|
content: "--listener-metrics-endpoint="
|
|
|
|
- it: should include watch-single-namespace flag when configured
|
|
set:
|
|
controller:
|
|
manager:
|
|
config:
|
|
watchSingleNamespace: "demo"
|
|
release:
|
|
name: "test-arc"
|
|
namespace: "test-ns"
|
|
asserts:
|
|
- contains:
|
|
path: spec.template.spec.containers[0].args
|
|
content: "--watch-single-namespace=demo"
|
|
|
|
- it: should include exclude-label-propagation-prefix flags when configured
|
|
set:
|
|
controller:
|
|
manager:
|
|
config:
|
|
excludeLabelPropagationPrefixes:
|
|
- "prefix.com/"
|
|
- "complete.io/label"
|
|
release:
|
|
name: "test-arc"
|
|
namespace: "test-ns"
|
|
asserts:
|
|
- contains:
|
|
path: spec.template.spec.containers[0].args
|
|
content: "--exclude-label-propagation-prefix=prefix.com/"
|
|
- contains:
|
|
path: spec.template.spec.containers[0].args
|
|
content: "--exclude-label-propagation-prefix=complete.io/label"
|
|
|
|
- it: should render metrics port when metrics are enabled
|
|
set:
|
|
controller:
|
|
metrics:
|
|
controllerManagerAddr: ":8080"
|
|
listenerAddr: ":8081"
|
|
listenerEndpoint: "/metrics"
|
|
release:
|
|
name: "test-arc"
|
|
namespace: "test-ns"
|
|
asserts:
|
|
- equal:
|
|
path: spec.template.spec.containers[0].ports[0].containerPort
|
|
value: 8080
|
|
- contains:
|
|
path: spec.template.spec.containers[0].args
|
|
content: "--metrics-addr=:8080"
|
|
- contains:
|
|
path: spec.template.spec.containers[0].args
|
|
content: "--listener-metrics-addr=:8081"
|
|
- contains:
|
|
path: spec.template.spec.containers[0].args
|
|
content: "--listener-metrics-endpoint=/metrics"
|
|
|
|
- it: should not include pprof arg by default
|
|
release:
|
|
name: "test-arc"
|
|
namespace: "test-ns"
|
|
asserts:
|
|
- notContains:
|
|
path: spec.template.spec.containers[0].args
|
|
content: "--pprof-addr="
|
|
|
|
- it: should not render pprof port by default
|
|
release:
|
|
name: "test-arc"
|
|
namespace: "test-ns"
|
|
asserts:
|
|
- notContains:
|
|
path: spec.template.spec.containers[0].ports
|
|
content:
|
|
name: pprof
|
|
|
|
- it: should include pprof arg when configured
|
|
set:
|
|
controller:
|
|
pprof:
|
|
addr: ":6060"
|
|
release:
|
|
name: "test-arc"
|
|
namespace: "test-ns"
|
|
asserts:
|
|
- contains:
|
|
path: spec.template.spec.containers[0].args
|
|
content: "--pprof-addr=:6060"
|
|
|
|
- it: should render pprof port when configured
|
|
set:
|
|
controller:
|
|
pprof:
|
|
addr: ":6060"
|
|
release:
|
|
name: "test-arc"
|
|
namespace: "test-ns"
|
|
asserts:
|
|
- contains:
|
|
path: spec.template.spec.containers[0].ports
|
|
content:
|
|
name: pprof
|
|
containerPort: 6060
|
|
protocol: TCP
|
|
|
|
- it: should fail when pprof addr is malformed (no numeric port)
|
|
set:
|
|
controller:
|
|
pprof:
|
|
addr: "localhost"
|
|
release:
|
|
name: "test-arc"
|
|
namespace: "test-ns"
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: "Values.controller.pprof.addr must end with a numeric port"
|
|
template: deployment.yaml
|