diff --git a/pkg/app/topaz.go b/pkg/app/topaz.go index 9fbc2823..29d5113e 100644 --- a/pkg/app/topaz.go +++ b/pkg/app/topaz.go @@ -265,30 +265,22 @@ type services struct { func mapToGRPCPorts(api map[string]*builder.API) map[string]services { portMap := make(map[string]services) + for key, config := range api { - serv := services{} if existing, ok := portMap[config.GRPC.ListenAddress]; ok { - serv = existing - serv.registeredServices = append(serv.registeredServices, key) + existing.registeredServices = append(existing.registeredServices, key) + if existing.API.Gateway.ListenAddress == "" && config.Gateway.ListenAddress != "" { + existing.API.Gateway = config.Gateway + } + portMap[config.GRPC.ListenAddress] = existing } else { + serv := services{} serv.registeredServices = append(serv.registeredServices, key) serv.API = config + portMap[config.GRPC.ListenAddress] = serv } - // set default gateway timeouts - if serv.API.Gateway.ReadTimeout == 0 { - serv.API.Gateway.ReadTimeout = 2 * time.Second - } - if serv.API.Gateway.ReadHeaderTimeout == 0 { - serv.API.Gateway.ReadHeaderTimeout = 2 * time.Second - } - if serv.API.Gateway.WriteTimeout == 0 { - serv.API.Gateway.WriteTimeout = 2 * time.Second - } - if serv.API.Gateway.IdleTimeout == 0 { - serv.API.Gateway.IdleTimeout = 30 * time.Second - } - portMap[config.GRPC.ListenAddress] = serv } + return portMap } diff --git a/pkg/cli/cc/health.go b/pkg/cli/cc/health.go index f7f548b3..577e6158 100644 --- a/pkg/cli/cc/health.go +++ b/pkg/cli/cc/health.go @@ -9,7 +9,7 @@ import ( healthpb "google.golang.org/grpc/health/grpc_health_v1" ) -const rpcTimeout = time.Second * 30 +const rpcTimeout = time.Second * 10 // ServiceHealthStatus adopted from grpc-health-probe cli implementation // https://github.com/grpc-ecosystem/grpc-health-probe/blob/master/main.go. diff --git a/pkg/cli/cmd/templates/install.go b/pkg/cli/cmd/templates/install.go index 731a0268..8418946c 100644 --- a/pkg/cli/cmd/templates/install.go +++ b/pkg/cli/cmd/templates/install.go @@ -122,6 +122,7 @@ func (cmd *InstallTemplateCmd) installTemplate(c *cc.CommonCtx, tmpl *template) CACertPath: "", Insecure: false, NoTLS: true, + NoProxy: false, } if healthy, err := cc.ServiceHealthStatus(c.Context, healthCfg, "model"); err != nil { @@ -375,20 +376,24 @@ func (i *tmplInstaller) runTemplateTests() error { Desc: "on-error", }, &azc.Config{ - Host: cc.AuthorizerSvc(), - APIKey: i.cfg.APIKey, - Token: i.cfg.Token, - Insecure: i.cfg.Insecure, - TenantID: i.cfg.TenantID, - Headers: i.cfg.Headers, + Host: cc.AuthorizerSvc(), + APIKey: i.cfg.APIKey, + Token: i.cfg.Token, + Insecure: i.cfg.Insecure, + Plaintext: i.cfg.Plaintext, + TenantID: i.cfg.TenantID, + Headers: i.cfg.Headers, + Timeout: i.cfg.Timeout, }, &dsc.Config{ - Host: i.cfg.Host, - APIKey: i.cfg.APIKey, - Token: i.cfg.Token, - Insecure: i.cfg.Insecure, - TenantID: i.cfg.TenantID, - Headers: i.cfg.Headers, + Host: i.cfg.Host, + APIKey: i.cfg.APIKey, + Token: i.cfg.Token, + Insecure: i.cfg.Insecure, + Plaintext: i.cfg.Plaintext, + TenantID: i.cfg.TenantID, + Headers: i.cfg.Headers, + Timeout: i.cfg.Timeout, }, ) if err != nil { diff --git a/pkg/service/builder/service_factory.go b/pkg/service/builder/service_factory.go index d5ea83c4..58af5b92 100644 --- a/pkg/service/builder/service_factory.go +++ b/pkg/service/builder/service_factory.go @@ -110,7 +110,7 @@ func (f *ServiceFactory) prepareGateway(config *API, gatewayOpts *GatewayOptions runtimeMux := f.gatewayMux(config.Gateway.AllowedHeaders, gatewayOpts.ErrorHandler) opts := []grpc.DialOption{} - if config.GRPC.Certs.HasCert() { + if config.GRPC.Certs.HasCA() { tlsCreds, err := config.GRPC.Certs.ClientCredentials(true) if err != nil { return nil, errors.Wrapf(err, "failed to get TLS credentials")