samples/grpc-ping-go: don't provide default (#959)

I was trying to connect to my grpc service at a custom domain like
`grpc-ping.default.IP.IP.IP.IP.xip.io` while omitting -server_host_override
and it resulted in bug https://github.com/knative/serving/issues/3307 which
took several days to figure out there was a default value for this flag.

Removing the default value as nobody's really owning grpc.knative.dev or
setting it as the custom domain in this sample.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
Ahmet Alp Balkan 2019-03-07 14:35:41 -08:00 committed by Knative Prow Robot
parent 74fa88ef49
commit 9f04556a89
1 changed files with 5 additions and 2 deletions

View File

@ -16,14 +16,17 @@ import (
var (
serverAddr = flag.String("server_addr", "127.0.0.1:8080", "The server address in the format of host:port")
serverHostOverride = flag.String("server_host_override", "grpc.knative.dev", "")
serverHostOverride = flag.String("server_host_override", "", "")
insecure = flag.Bool("insecure", false, "Set to true to skip SSL validation")
)
func main() {
flag.Parse()
opts := []grpc.DialOption{grpc.WithAuthority(*serverHostOverride)}
var opts []grpc.DialOption
if *serverHostOverride != "" {
opts = append(opts, grpc.WithAuthority(*serverHostOverride))
}
if *insecure {
opts = append(opts, grpc.WithInsecure())
}