mirror of https://github.com/status-im/consul.git
Merge pull request #14034 from hashicorp/make-proxy-sidecar-for-case-insensitive
Allow uppercase in proxy launch -sidecar-for arg
This commit is contained in:
commit
1200e83c3b
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:bug
|
||||||
|
cli: When launching a sidecar proxy with `consul connect envoy` or `consul connect proxy`, the `-sidecar-for` service ID argument is now treated as case-insensitive.
|
||||||
|
```
|
|
@ -232,7 +232,7 @@ func LookupProxyIDForSidecar(client *api.Client, sidecarFor string) (string, err
|
||||||
var proxyIDs []string
|
var proxyIDs []string
|
||||||
for _, svc := range svcs {
|
for _, svc := range svcs {
|
||||||
if svc.Kind == api.ServiceKindConnectProxy && svc.Proxy != nil &&
|
if svc.Kind == api.ServiceKindConnectProxy && svc.Proxy != nil &&
|
||||||
strings.ToLower(svc.Proxy.DestinationServiceID) == sidecarFor {
|
strings.EqualFold(svc.Proxy.DestinationServiceID, sidecarFor) {
|
||||||
proxyIDs = append(proxyIDs, svc.ID)
|
proxyIDs = append(proxyIDs, svc.ID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,6 +110,17 @@ func TestCommandConfigWatcher(t *testing.T) {
|
||||||
require.Equal(t, 9999, cfg.PublicListener.BindPort)
|
require.Equal(t, 9999, cfg.PublicListener.BindPort)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
Name: "-sidecar-for, one sidecar case-insensitive",
|
||||||
|
Flags: []string{
|
||||||
|
"-sidecar-for", "One-SideCar",
|
||||||
|
},
|
||||||
|
Test: func(t *testing.T, cfg *proxy.Config) {
|
||||||
|
// Sanity check we got the right instance.
|
||||||
|
require.Equal(t, 9999, cfg.PublicListener.BindPort)
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
|
|
Loading…
Reference in New Issue