Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit 5ff2c3e

Browse files
committed
Fix is_service_runner to detect endpoints ending with /
----Release Notes---- [] ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=124576889
1 parent 5cf2b03 commit 5ff2c3e

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

google/cloud/dataflow/utils/pipeline_options_validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class PipelineOptionsValidator(object):
7070
JOB_PATTERN = '[a-z]([-a-z0-9]*[a-z0-9])?'
7171
PROJECT_ID_PATTERN = '[a-z][-a-z0-9:.]+[a-z0-9]'
7272
PROJECT_NUMBER_PATTERN = '[0-9]*'
73-
ENDPOINT_PATTERN = r'https://[\S]*googleapis\.com'
73+
ENDPOINT_PATTERN = r'https://[\S]*googleapis\.com[/]?'
7474

7575
def __init__(self, options, runner):
7676
self.options = options

google/cloud/dataflow/utils/pipeline_options_validator_test.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,31 @@ def test_is_service_runner(self):
192192
'options': ['--dataflow_endpoint=https://dataflow.googleapis.com'],
193193
'expected': False,
194194
},
195+
{
196+
'runner': MockRunners.OtherRunner(),
197+
'options': ['--dataflow_endpoint=https://dataflow.googleapis.com/'],
198+
'expected': False,
199+
},
195200
{
196201
'runner': MockRunners.DataflowPipelineRunner(),
197202
'options': ['--dataflow_endpoint=https://another.service.com'],
198203
'expected': False,
199204
},
205+
{
206+
'runner': MockRunners.DataflowPipelineRunner(),
207+
'options': ['--dataflow_endpoint=https://another.service.com/'],
208+
'expected': False,
209+
},
200210
{
201211
'runner': MockRunners.DataflowPipelineRunner(),
202212
'options': ['--dataflow_endpoint=https://dataflow.googleapis.com'],
203213
'expected': True,
204214
},
215+
{
216+
'runner': MockRunners.DataflowPipelineRunner(),
217+
'options': ['--dataflow_endpoint=https://dataflow.googleapis.com/'],
218+
'expected': True,
219+
},
205220
{
206221
'runner': MockRunners.DataflowPipelineRunner(),
207222
'options': [],

0 commit comments

Comments
 (0)