Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions cmd/common/api_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
6 changes: 6 additions & 0 deletions cmd/other/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/configs/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
Loading