From cc04d04a48a4a4266f480700c4706333a2bd9df9 Mon Sep 17 00:00:00 2001 From: Mario de la Ossa Date: Thu, 10 Oct 2024 10:38:00 -0600 Subject: [PATCH] Add gRPC as valid endpoint type (#69) * Add gRPC as valid endpoint type * missing error message --- aptible/endpoints.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/aptible/endpoints.go b/aptible/endpoints.go index bd088d7..9582d9a 100644 --- a/aptible/endpoints.go +++ b/aptible/endpoints.go @@ -68,7 +68,7 @@ func (c *Client) CreateEndpoint(service Service, attrs EndpointCreateAttrs) (End request.ContainerPort = attrs.ContainerPort } - if *attrs.Type != "http_proxy_protocol" && *attrs.Type != "http" { + if *attrs.Type != "http_proxy_protocol" && *attrs.Type != "http" && *attrs.Type != "grpc" { request.ContainerPorts = attrs.ContainerPorts } @@ -285,8 +285,10 @@ func GetEndpointType(t string) (string, error) { return "tcp", nil case "TLS", "tls": return "tls", nil + case "GRPC", "gRPC", "grpc": + return "grpc", nil default: - e := fmt.Errorf("invalid endpoint type, please use HTTPS, TLS, or TCP") + e := fmt.Errorf("invalid endpoint type, please use HTTPS, TLS, GRPC, or TCP") return "", e } } @@ -299,6 +301,8 @@ func GetHumanReadableEndpointType(t string) (string, error) { return "tcp", nil case "tls": return "tls", nil + case "grpc": + return "grpc", nil default: e := fmt.Errorf("invalid endpoint type - %s", t) return "", e