Add TestParseAndValidateConfigBytesWithKubernetesAutoDiscoveryUsingClusterModeIn

This commit is contained in:
TwinProduction 2020-11-11 18:20:52 -05:00
parent cf968cbf86
commit 5d29f944c4

View File

@ -411,3 +411,22 @@ kubernetes:
`))
t.Error("Function should've panicked because providing a service-template is mandatory")
}
func TestParseAndValidateConfigBytesWithKubernetesAutoDiscoveryUsingClusterModeIn(t *testing.T) {
defer func() { recover() }()
_, _ = parseAndValidateConfigBytes([]byte(`
kubernetes:
cluster-mode: "in"
auto-discover: true
service-template:
interval: 30s
conditions:
- "[STATUS] == 200"
namespaces:
- name: default
hostname-suffix: ".default.svc.cluster.local"
target-path: "/health"
`))
// TODO: find a way to test this?
t.Error("Function should've panicked because testing with ClusterModeIn isn't supported")
}