Skip to content

Commit

Permalink
Create matchamker-endpoint variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Nogueira Gonçalves committed Oct 4, 2022
1 parent 67d3c57 commit ec3244b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion _VERSION_MIGRATION/migrate-to-next.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# global variables
game = ""
scheduler = ""
matchmaker_endpoint = ""
backup_folder_absolute_path = ""
maestro_v9_endpoint = ""
maestro_next_endpoint = ""
Expand Down Expand Up @@ -38,14 +39,21 @@ def get_port_range():


def get_forwarders(forwarders):
matchmaker_address = ""

if matchmaker_endpoint != ""
matchmaker_address = matchmaker_endpoint
else
matchmaker_address = 'matchmaker-rpc.matchmaker.svc.cluster.local:80'

if not forwarders:
return []
try:
return [{
"name": 'matchmaking',
"enable": forwarders['grpc']['matchmaking']['enabled'],
"type": "gRPC",
"address": 'matchmaker-rpc.matchmaker.svc.cluster.local:80',
"address": matchmaker_address,
"options": {
"timeout": '1000',
"metadata": forwarders['grpc']['matchmaking']['metadata']
Expand Down Expand Up @@ -490,6 +498,7 @@ def main():
def setup():
global maestro_v9_endpoint
global maestro_next_endpoint
global matchmaker_endpoint
global game
global scheduler
global backup_folder_absolute_path
Expand Down Expand Up @@ -534,6 +543,13 @@ def setup():
required=False,
help='Name of the scheduler containing the schedulers to be migrated')

my_parser.add_argument('-m',
'--matchmaker-url',
metavar='matchmaker_url',
type=str,
required=False,
help='URL of the matchmaker to forward rooms and player events')

my_parser.add_argument('-f',
'--yaml_file',
metavar='container_env_vars_file',
Expand All @@ -557,6 +573,7 @@ def setup():

maestro_v9_endpoint = args.old_url
maestro_next_endpoint = args.new_url
matchmaker_endpoint = args.matchmaker_url
game = args.game
scheduler = args.scheduler
backup_folder_absolute_path = args.backup
Expand Down

0 comments on commit ec3244b

Please sign in to comment.