@@ -163,7 +163,9 @@ def write_nginx_conf(ingress, nginx_conf, args):
163
163
server_config_path = args .server_config_path ,
164
164
experimental_proxy_backend_host_header = args .experimental_proxy_backend_host_header ,
165
165
enable_strict_transport_security = args .enable_strict_transport_security ,
166
- google_cloud_platform = (args .non_gcp == False ))
166
+ google_cloud_platform = (args .non_gcp == False ),
167
+ server_config_dir = args .server_config_dir ,
168
+ services = args .services )
167
169
168
170
# Save nginx conf
169
171
try :
@@ -366,6 +368,8 @@ def fetch_service_config(args):
366
368
logging .error ("[ESP] Service name is not specified" );
367
369
sys .exit (3 )
368
370
371
+ args .services = args .service .split ('|' )
372
+
369
373
# fetch service config rollout strategy from metadata, if not specified
370
374
if (args .rollout_strategy is None or not args .rollout_strategy .strip ()) and args .check_metadata :
371
375
logging .info (
@@ -384,9 +388,7 @@ def fetch_service_config(args):
384
388
385
389
# Fetch api version from latest successful rollouts
386
390
if args .version is None or not args .version .strip ():
387
- services = args .service .split ('|' )
388
- args .services = services
389
- for idx , service in enumerate (services ):
391
+ for idx , service in enumerate (args .services ):
390
392
logging .info (
391
393
"Fetching the service config ID from the rollouts service" )
392
394
rollout = fetch .fetch_latest_rollout (args .management ,
@@ -1035,16 +1037,23 @@ def enforce_conflict_args(args):
1035
1037
logging .error (check_conflict_result )
1036
1038
sys .exit (3 )
1037
1039
1038
- if args .service and '|' in args .service :
1039
- if args .experimental_enable_multiple_api_configs == False :
1040
- logging .error ("[ESP] The flag --experimental_enable_multiple_api_configs must be enabled when --service specifies multiple services" )
1041
- sys .exit (3 )
1042
- if args .version :
1043
- logging .error ("[ESP] --version is not allowed when --service specifies multiple services" )
1044
- sys .exit (3 )
1045
- if args .server_config_generation_path and not args .server_config_generation_path .endswith ('/' ):
1046
- logging .error ("[ESP] --server_config_generation_path must end with / when --service specifies multiple services" )
1047
- sys .exit (3 )
1040
+ if args .service :
1041
+ if '|' in args .service :
1042
+ if not args .experimental_enable_multiple_api_configs :
1043
+ logging .error ("[ESP] The flag --experimental_enable_multiple_api_configs must be enabled when --service specifies multiple services" )
1044
+ sys .exit (3 )
1045
+ if args .version :
1046
+ logging .error ("[ESP] --version is not allowed when --service specifies multiple services" )
1047
+ sys .exit (3 )
1048
+ if args .server_config_generation_path and not args .server_config_generation_path .endswith ('/' ):
1049
+ logging .error ("[ESP] --server_config_generation_path must end with / when --service specifies multiple services" )
1050
+ sys .exit (3 )
1051
+
1052
+ args .services = args .service .split ('|' )
1053
+ else :
1054
+ args .services = [args .service ]
1055
+ else :
1056
+ args .services = []
1048
1057
1049
1058
# Set credentials file from the environment variable
1050
1059
if args .service_account_key is None :
0 commit comments