Flags publish-service and publish-status-address are mutually exclusive

This commit is contained in:
Manuel Alejandro de Brito Fontes 2018-10-08 15:00:38 -03:00
parent 3cf00b2fd8
commit 0971f8443f
2 changed files with 17 additions and 0 deletions

View file

@ -62,3 +62,16 @@ func TestDefaults(t *testing.T) {
func TestSetupSSLProxy(t *testing.T) {
// TODO
}
func TestFlagConflict(t *testing.T) {
resetForTesting(func() { t.Fatal("Parsing failed") })
oldArgs := os.Args
defer func() { os.Args = oldArgs }()
os.Args = []string{"cmd", "--publish-service", "namespace/test", "--http-port", "0", "--https-port", "0", "--publish-status-address", "1.1.1.1"}
_, _, err := parseFlags()
if err == nil {
t.Fatalf("Expected an error parsing flags but none returned")
}
}