diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2021-07-02 13:03:10 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2021-07-02 13:03:10 +0200 |
commit | 735be12481cdc3edfcbca3500172d2164255e1a3 (patch) | |
tree | 67f0ee2916812072967707ae6de779ebbcdb0476 /vendor/google.golang.org/grpc/internal/grpcutil | |
parent | 7eb9ed975899ffe12fb82066aebf652444205e02 (diff) | |
download | podman-735be12481cdc3edfcbca3500172d2164255e1a3.tar.gz podman-735be12481cdc3edfcbca3500172d2164255e1a3.tar.bz2 podman-735be12481cdc3edfcbca3500172d2164255e1a3.zip |
force github.com/spf13/cobra@v1.1.3
v1.2.0 is breaking CI (see containers/podman/pull/10844).
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/google.golang.org/grpc/internal/grpcutil')
-rw-r--r-- | vendor/google.golang.org/grpc/internal/grpcutil/target.go | 42 |
1 files changed, 4 insertions, 38 deletions
diff --git a/vendor/google.golang.org/grpc/internal/grpcutil/target.go b/vendor/google.golang.org/grpc/internal/grpcutil/target.go index 8833021da..80b33cdaf 100644 --- a/vendor/google.golang.org/grpc/internal/grpcutil/target.go +++ b/vendor/google.golang.org/grpc/internal/grpcutil/target.go @@ -37,53 +37,19 @@ func split2(s, sep string) (string, string, bool) { } // ParseTarget splits target into a resolver.Target struct containing scheme, -// authority and endpoint. skipUnixColonParsing indicates that the parse should -// not parse "unix:[path]" cases. This should be true in cases where a custom -// dialer is present, to prevent a behavior change. +// authority and endpoint. // -// If target is not a valid scheme://authority/endpoint as specified in -// https://github.com/grpc/grpc/blob/master/doc/naming.md, -// it returns {Endpoint: target}. -func ParseTarget(target string, skipUnixColonParsing bool) (ret resolver.Target) { +// If target is not a valid scheme://authority/endpoint, it returns {Endpoint: +// target}. +func ParseTarget(target string) (ret resolver.Target) { var ok bool - if strings.HasPrefix(target, "unix-abstract:") { - if strings.HasPrefix(target, "unix-abstract://") { - // Maybe, with Authority specified, try to parse it - var remain string - ret.Scheme, remain, _ = split2(target, "://") - ret.Authority, ret.Endpoint, ok = split2(remain, "/") - if !ok { - // No Authority, add the "//" back - ret.Endpoint = "//" + remain - } else { - // Found Authority, add the "/" back - ret.Endpoint = "/" + ret.Endpoint - } - } else { - // Without Authority specified, split target on ":" - ret.Scheme, ret.Endpoint, _ = split2(target, ":") - } - return ret - } ret.Scheme, ret.Endpoint, ok = split2(target, "://") if !ok { - if strings.HasPrefix(target, "unix:") && !skipUnixColonParsing { - // Handle the "unix:[local/path]" and "unix:[/absolute/path]" cases, - // because splitting on :// only handles the - // "unix://[/absolute/path]" case. Only handle if the dialer is nil, - // to avoid a behavior change with custom dialers. - return resolver.Target{Scheme: "unix", Endpoint: target[len("unix:"):]} - } return resolver.Target{Endpoint: target} } ret.Authority, ret.Endpoint, ok = split2(ret.Endpoint, "/") if !ok { return resolver.Target{Endpoint: target} } - if ret.Scheme == "unix" { - // Add the "/" back in the unix case, so the unix resolver receives the - // actual endpoint in the "unix://[/absolute/path]" case. - ret.Endpoint = "/" + ret.Endpoint - } return ret } |