@@ -301,6 +301,43 @@ func TestPrepareMountArgs(t *testing.T) {
301301 "cache-dir" : "/gcsfuse-file-cache-ephemeral-disk/.volumes/volume-name" ,
302302 },
303303 },
304+ {
305+ name : "should correctly parse custom-endpoint with a port" ,
306+ mc : & MountConfig {
307+ BucketName : "test-bucket" ,
308+ BufferDir : "test-buffer-dir" ,
309+ CacheDir : "test-cache-dir" ,
310+ ConfigFile : "test-config-file" ,
311+ Options : []string {"gcs-connection:custom-endpoint:custom-service.my-system.svc.cluster.local:8080" },
312+ },
313+ expectedArgs : defaultFlagMap ,
314+ expectedConfigMapArgs : map [string ]string {
315+ "logging:file-path" : "/dev/fd/1" ,
316+ "logging:format" : "json" ,
317+ "cache-dir" : "" ,
318+ "gcs-connection:custom-endpoint" : "custom-service.my-system.svc.cluster.local:8080" ,
319+ },
320+ },
321+ {
322+ name : "should correctly parse custom-endpoint with a port in CLI format" ,
323+ mc : & MountConfig {
324+ BucketName : "test-bucket" ,
325+ BufferDir : "test-buffer-dir" ,
326+ CacheDir : "test-cache-dir" ,
327+ ConfigFile : "test-config-file" ,
328+ Options : []string {"custom-endpoint=custom-service.my-system.svc.cluster.local:8080" },
329+ },
330+ expectedArgs : map [string ]string {
331+ "app-name" : GCSFuseAppName ,
332+ "temp-dir" : "test-buffer-dir/temp-dir" ,
333+ "config-file" : "test-config-file" ,
334+ "foreground" : "" ,
335+ "uid" : "0" ,
336+ "gid" : "0" ,
337+ "custom-endpoint" : "custom-service.my-system.svc.cluster.local:8080" ,
338+ },
339+ expectedConfigMapArgs : defaultConfigFileFlagMap ,
340+ },
304341 }
305342
306343 testPrometheusPort := prometheusPort
0 commit comments