@@ -45,7 +45,7 @@ func TestNewCommandArguments(t *testing.T) {
4545 c .Instances = []proxy.InstanceConnConfig {{}}
4646 }
4747 if i := & c .Instances [0 ]; i .Name == "" {
48- i .Name = "/ projects/proj/locations/region/clusters/clust/instances/inst"
48+ i .Name = "projects/proj/locations/region/clusters/clust/instances/inst"
4949 }
5050 if c .APIEndpointURL == "" {
5151 c .APIEndpointURL = "https://alloydb.googleapis.com/v1beta"
@@ -59,56 +59,56 @@ func TestNewCommandArguments(t *testing.T) {
5959 }{
6060 {
6161 desc : "basic invocation with defaults" ,
62- args : []string {"/ projects/proj/locations/region/clusters/clust/instances/inst" },
62+ args : []string {"projects/proj/locations/region/clusters/clust/instances/inst" },
6363 want : withDefaults (& proxy.Config {
6464 Addr : "127.0.0.1" ,
65- Instances : []proxy.InstanceConnConfig {{Name : "/ projects/proj/locations/region/clusters/clust/instances/inst" }},
65+ Instances : []proxy.InstanceConnConfig {{Name : "projects/proj/locations/region/clusters/clust/instances/inst" }},
6666 }),
6767 },
6868 {
6969 desc : "using the address flag" ,
70- args : []string {"--address" , "0.0.0.0" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
70+ args : []string {"--address" , "0.0.0.0" , "projects/proj/locations/region/clusters/clust/instances/inst" },
7171 want : withDefaults (& proxy.Config {
7272 Addr : "0.0.0.0" ,
73- Instances : []proxy.InstanceConnConfig {{Name : "/ projects/proj/locations/region/clusters/clust/instances/inst" }},
73+ Instances : []proxy.InstanceConnConfig {{Name : "projects/proj/locations/region/clusters/clust/instances/inst" }},
7474 }),
7575 },
7676 {
7777 desc : "using the address (short) flag" ,
78- args : []string {"-a" , "0.0.0.0" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
78+ args : []string {"-a" , "0.0.0.0" , "projects/proj/locations/region/clusters/clust/instances/inst" },
7979 want : withDefaults (& proxy.Config {
8080 Addr : "0.0.0.0" ,
81- Instances : []proxy.InstanceConnConfig {{Name : "/ projects/proj/locations/region/clusters/clust/instances/inst" }},
81+ Instances : []proxy.InstanceConnConfig {{Name : "projects/proj/locations/region/clusters/clust/instances/inst" }},
8282 }),
8383 },
8484 {
8585 desc : "using the address query param" ,
86- args : []string {"/ projects/proj/locations/region/clusters/clust/instances/inst?address=0.0.0.0" },
86+ args : []string {"projects/proj/locations/region/clusters/clust/instances/inst?address=0.0.0.0" },
8787 want : withDefaults (& proxy.Config {
8888 Addr : "127.0.0.1" ,
8989 Instances : []proxy.InstanceConnConfig {{
9090 Addr : "0.0.0.0" ,
91- Name : "/ projects/proj/locations/region/clusters/clust/instances/inst" ,
91+ Name : "projects/proj/locations/region/clusters/clust/instances/inst" ,
9292 }},
9393 }),
9494 },
9595 {
9696 desc : "using the port flag" ,
97- args : []string {"--port" , "6000" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
97+ args : []string {"--port" , "6000" , "projects/proj/locations/region/clusters/clust/instances/inst" },
9898 want : withDefaults (& proxy.Config {
9999 Port : 6000 ,
100100 }),
101101 },
102102 {
103103 desc : "using the port (short) flag" ,
104- args : []string {"-p" , "6000" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
104+ args : []string {"-p" , "6000" , "projects/proj/locations/region/clusters/clust/instances/inst" },
105105 want : withDefaults (& proxy.Config {
106106 Port : 6000 ,
107107 }),
108108 },
109109 {
110110 desc : "using the port query param" ,
111- args : []string {"/ projects/proj/locations/region/clusters/clust/instances/inst?port=6000" },
111+ args : []string {"projects/proj/locations/region/clusters/clust/instances/inst?port=6000" },
112112 want : withDefaults (& proxy.Config {
113113 Instances : []proxy.InstanceConnConfig {{
114114 Port : 6000 ,
@@ -117,49 +117,49 @@ func TestNewCommandArguments(t *testing.T) {
117117 },
118118 {
119119 desc : "using the token flag" ,
120- args : []string {"--token" , "MYCOOLTOKEN" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
120+ args : []string {"--token" , "MYCOOLTOKEN" , "projects/proj/locations/region/clusters/clust/instances/inst" },
121121 want : withDefaults (& proxy.Config {
122122 Token : "MYCOOLTOKEN" ,
123123 }),
124124 },
125125 {
126126 desc : "using the token (short) flag" ,
127- args : []string {"-t" , "MYCOOLTOKEN" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
127+ args : []string {"-t" , "MYCOOLTOKEN" , "projects/proj/locations/region/clusters/clust/instances/inst" },
128128 want : withDefaults (& proxy.Config {
129129 Token : "MYCOOLTOKEN" ,
130130 }),
131131 },
132132 {
133133 desc : "using the credentiale file flag" ,
134- args : []string {"--credentials-file" , "/path/to/file" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
134+ args : []string {"--credentials-file" , "/path/to/file" , "projects/proj/locations/region/clusters/clust/instances/inst" },
135135 want : withDefaults (& proxy.Config {
136136 CredentialsFile : "/path/to/file" ,
137137 }),
138138 },
139139 {
140140 desc : "using the (short) credentiale file flag" ,
141- args : []string {"-c" , "/path/to/file" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
141+ args : []string {"-c" , "/path/to/file" , "projects/proj/locations/region/clusters/clust/instances/inst" },
142142 want : withDefaults (& proxy.Config {
143143 CredentialsFile : "/path/to/file" ,
144144 }),
145145 },
146146 {
147147 desc : "using the unix socket flag" ,
148- args : []string {"--unix-socket" , "/path/to/dir/" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
148+ args : []string {"--unix-socket" , "/path/to/dir/" , "projects/proj/locations/region/clusters/clust/instances/inst" },
149149 want : withDefaults (& proxy.Config {
150150 UnixSocket : "/path/to/dir/" ,
151151 }),
152152 },
153153 {
154154 desc : "using the (short) unix socket flag" ,
155- args : []string {"-u" , "/path/to/dir/" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
155+ args : []string {"-u" , "/path/to/dir/" , "projects/proj/locations/region/clusters/clust/instances/inst" },
156156 want : withDefaults (& proxy.Config {
157157 UnixSocket : "/path/to/dir/" ,
158158 }),
159159 },
160160 {
161161 desc : "using the unix socket query param" ,
162- args : []string {"/ projects/proj/locations/region/clusters/clust/instances/inst?unix-socket=/path/to/dir/" },
162+ args : []string {"projects/proj/locations/region/clusters/clust/instances/inst?unix-socket=/path/to/dir/" },
163163 want : withDefaults (& proxy.Config {
164164 Instances : []proxy.InstanceConnConfig {{
165165 UnixSocket : "/path/to/dir/" ,
@@ -168,35 +168,35 @@ func TestNewCommandArguments(t *testing.T) {
168168 },
169169 {
170170 desc : "using the max connections flag" ,
171- args : []string {"--max-connections" , "1" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
171+ args : []string {"--max-connections" , "1" , "projects/proj/locations/region/clusters/clust/instances/inst" },
172172 want : withDefaults (& proxy.Config {
173173 MaxConnections : 1 ,
174174 }),
175175 },
176176 {
177177 desc : "using wait after signterm flag" ,
178- args : []string {"--max-sigterm-delay" , "10s" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
178+ args : []string {"--max-sigterm-delay" , "10s" , "projects/proj/locations/region/clusters/clust/instances/inst" },
179179 want : withDefaults (& proxy.Config {
180180 WaitOnClose : 10 * time .Second ,
181181 }),
182182 },
183183 {
184184 desc : "enabling structured logging" ,
185- args : []string {"--structured-logs" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
185+ args : []string {"--structured-logs" , "projects/proj/locations/region/clusters/clust/instances/inst" },
186186 want : withDefaults (& proxy.Config {
187187 StructuredLogs : true ,
188188 }),
189189 },
190190 {
191191 desc : "using the alloydbadmin-api-endpoint flag with the trailing slash" ,
192- args : []string {"--alloydbadmin-api-endpoint" , "https://test.googleapis.com/" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
192+ args : []string {"--alloydbadmin-api-endpoint" , "https://test.googleapis.com/" , "projects/proj/locations/region/clusters/clust/instances/inst" },
193193 want : withDefaults (& proxy.Config {
194194 APIEndpointURL : "https://test.googleapis.com" ,
195195 }),
196196 },
197197 {
198198 desc : "using the alloydbadmin-api-endpoint flag without the trailing slash" ,
199- args : []string {"--alloydbadmin-api-endpoint" , "https://test.googleapis.com" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
199+ args : []string {"--alloydbadmin-api-endpoint" , "https://test.googleapis.com" , "projects/proj/locations/region/clusters/clust/instances/inst" },
200200 want : withDefaults (& proxy.Config {
201201 APIEndpointURL : "https://test.googleapis.com" ,
202202 }),
@@ -238,12 +238,12 @@ func TestNewCommandWithGcloudAuth(t *testing.T) {
238238 }{
239239 {
240240 desc : "using the gcloud auth flag" ,
241- args : []string {"--gcloud-auth" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
241+ args : []string {"--gcloud-auth" , "projects/proj/locations/region/clusters/clust/instances/inst" },
242242 want : true ,
243243 },
244244 {
245245 desc : "using the (short) gcloud auth flag" ,
246- args : []string {"-g" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
246+ args : []string {"-g" , "projects/proj/locations/region/clusters/clust/instances/inst" },
247247 want : true ,
248248 },
249249 }
@@ -282,41 +282,41 @@ func TestNewCommandWithErrors(t *testing.T) {
282282 },
283283 {
284284 desc : "when the query string is bogus" ,
285- args : []string {"/ projects/proj/locations/region/clusters/clust/instances/inst?%=foo" },
285+ args : []string {"projects/proj/locations/region/clusters/clust/instances/inst?%=foo" },
286286 },
287287 {
288288 desc : "when the address query param is empty" ,
289- args : []string {"/ projects/proj/locations/region/clusters/clust/instances/inst?address=" },
289+ args : []string {"projects/proj/locations/region/clusters/clust/instances/inst?address=" },
290290 },
291291 {
292292 desc : "using the address flag with a bad IP address" ,
293- args : []string {"--address" , "bogus" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
293+ args : []string {"--address" , "bogus" , "projects/proj/locations/region/clusters/clust/instances/inst" },
294294 },
295295 {
296296 desc : "when the address query param is not an IP address" ,
297- args : []string {"/ projects/proj/locations/region/clusters/clust/instances/inst?address=世界" },
297+ args : []string {"projects/proj/locations/region/clusters/clust/instances/inst?address=世界" },
298298 },
299299 {
300300 desc : "when the address query param contains multiple values" ,
301- args : []string {"/ projects/proj/locations/region/clusters/clust/instances/inst?address=0.0.0.0&address=1.1.1.1&address=2.2.2.2" },
301+ args : []string {"projects/proj/locations/region/clusters/clust/instances/inst?address=0.0.0.0&address=1.1.1.1&address=2.2.2.2" },
302302 },
303303 {
304304 desc : "when the query string is invalid" ,
305- args : []string {"/ projects/proj/locations/region/clusters/clust/instances/inst?address=1.1.1.1?foo=2.2.2.2" },
305+ args : []string {"projects/proj/locations/region/clusters/clust/instances/inst?address=1.1.1.1?foo=2.2.2.2" },
306306 },
307307 {
308308 desc : "when the port query param contains multiple values" ,
309- args : []string {"/ projects/proj/locations/region/clusters/clust/instances/inst?port=1&port=2" },
309+ args : []string {"projects/proj/locations/region/clusters/clust/instances/inst?port=1&port=2" },
310310 },
311311 {
312312 desc : "when the port query param is not a number" ,
313- args : []string {"/ projects/proj/locations/region/clusters/clust/instances/inst?port=hi" },
313+ args : []string {"projects/proj/locations/region/clusters/clust/instances/inst?port=hi" },
314314 },
315315 {
316316 desc : "when both token and credentials file are set" ,
317317 args : []string {
318318 "--token" , "my-token" ,
319- "--credentials-file" , "/path/to/file" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
319+ "--credentials-file" , "/path/to/file" , "projects/proj/locations/region/clusters/clust/instances/inst" },
320320 },
321321 {
322322 desc : "when both token and gcloud auth are set" ,
@@ -332,23 +332,23 @@ func TestNewCommandWithErrors(t *testing.T) {
332332 },
333333 {
334334 desc : "when the unix socket query param contains multiple values" ,
335- args : []string {"/ projects/proj/locations/region/clusters/clust/instances/inst?unix-socket=/one&unix-socket=/two" },
335+ args : []string {"projects/proj/locations/region/clusters/clust/instances/inst?unix-socket=/one&unix-socket=/two" },
336336 },
337337 {
338338 desc : "using the unix socket flag with addr" ,
339- args : []string {"-u" , "/path/to/dir/" , "-a" , "127.0.0.1" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
339+ args : []string {"-u" , "/path/to/dir/" , "-a" , "127.0.0.1" , "projects/proj/locations/region/clusters/clust/instances/inst" },
340340 },
341341 {
342342 desc : "using the unix socket flag with port" ,
343- args : []string {"-u" , "/path/to/dir/" , "-p" , "5432" , "/ projects/proj/locations/region/clusters/clust/instances/inst" },
343+ args : []string {"-u" , "/path/to/dir/" , "-p" , "5432" , "projects/proj/locations/region/clusters/clust/instances/inst" },
344344 },
345345 {
346346 desc : "using the unix socket and addr query params" ,
347- args : []string {"/ projects/proj/locations/region/clusters/clust/instances/inst?unix-socket=/path&address=127.0.0.1" },
347+ args : []string {"projects/proj/locations/region/clusters/clust/instances/inst?unix-socket=/path&address=127.0.0.1" },
348348 },
349349 {
350350 desc : "using the unix socket and port query params" ,
351- args : []string {"/ projects/proj/locations/region/clusters/clust/instances/inst?unix-socket=/path&port=5000" },
351+ args : []string {"projects/proj/locations/region/clusters/clust/instances/inst?unix-socket=/path&port=5000" },
352352 },
353353 {
354354 desc : "enabling a Prometheus port without a namespace" ,
0 commit comments