diff --git a/cmd/common/api_resources.go b/cmd/common/api_resources.go index 56da512..4692f25 100644 --- a/cmd/common/api_resources.go +++ b/cmd/common/api_resources.go @@ -103,15 +103,7 @@ func FetchServiceResources(serviceName, endpoint string, shortNamesMap map[strin creds := credentials.NewTLS(tlsConfig) opts = append(opts, grpc.WithTransportCredentials(creds)) } else if scheme == "grpc" { - if strings.Contains(hostPort, ".svc.cluster.local") { - tlsConfig := &tls.Config{ - InsecureSkipVerify: true, - } - creds := credentials.NewTLS(tlsConfig) - opts = append(opts, grpc.WithTransportCredentials(creds)) - } else { - opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials())) - } + opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials())) } else { return nil, fmt.Errorf("unsupported scheme: %s", scheme) } diff --git a/cmd/other/login.go b/cmd/other/login.go index c6efe8d..d10b741 100644 --- a/cmd/other/login.go +++ b/cmd/other/login.go @@ -1321,6 +1321,12 @@ func fetchWorkspaces(baseUrl string, identityEndpoint string, hasIdentityService } creds := credentials.NewTLS(tlsConfig) opts = append(opts, grpc.WithTransportCredentials(creds)) + } else if strings.HasPrefix(identityEndpoint, "grpc://") { + tlsConfig := &tls.Config{ + InsecureSkipVerify: true, + } + creds := credentials.NewTLS(tlsConfig) + opts = append(opts, grpc.WithTransportCredentials(creds)) } else { opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials())) } diff --git a/pkg/configs/endpoint.go b/pkg/configs/endpoint.go index ae52e04..d7e58c1 100644 --- a/pkg/configs/endpoint.go +++ b/pkg/configs/endpoint.go @@ -133,7 +133,8 @@ func GetServiceEndpoint(config *Environments, serviceName string) (string, error } if strings.HasPrefix(envConfig.Endpoint, "grpc://") { - if strings.Contains(envConfig.Endpoint, "localhost") { + // Allow both localhost and cluster-internal addresses + if strings.Contains(envConfig.Endpoint, "localhost") || strings.Contains(envConfig.Endpoint, ".svc.cluster.local") { return envConfig.Endpoint, nil } }