Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
fix: change worksheet (#1610)
Browse files Browse the repository at this point in the history
* debug

* fix aimmo-game versions

* add more try-except around ingress in game-creator

* skip archived from running games

* cleanup

* set pytest in setup in aimmo-game

* and pytest-aiohttp
  • Loading branch information
razvan-pro authored Jan 25, 2022
1 parent 7178660 commit 799dce1
Show file tree
Hide file tree
Showing 5 changed files with 309 additions and 368 deletions.
12 changes: 11 additions & 1 deletion aimmo-game-creator/game_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,13 @@ def _add_path_to_ingress(self, game_id):

patch = [{"op": "add", "path": "/spec/rules/0/http/paths/-", "value": path}]

self.networking_api.patch_namespaced_ingress("aimmo-ingress", "default", patch)
# This exception is usually triggered locally where there is no ingress.
try:
self.networking_api.patch_namespaced_ingress(
"aimmo-ingress", "default", patch
)
except ApiException as e:
LOGGER.exception(e)

def _remove_path_from_ingress(self, game_id):
game_name = KubernetesGameManager._create_game_name(game_id)
Expand All @@ -200,9 +206,13 @@ def _remove_path_from_ingress(self, game_id):
)
try:
ingress = self.networking_api.list_namespaced_ingress("default").items[0]
# These exceptions are usually triggered locally where there is no ingress.
except IndexError:
LOGGER.warning("No ingress found to remove path from.")
return
except ApiException as e:
LOGGER.exception(e)
return
paths = ingress.spec.rules[0].http.paths
try:
index_to_delete = paths.index(path)
Expand Down
15 changes: 8 additions & 7 deletions aimmo-game/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ name = "pypi"

[dev-packages]
pytest = "~=6.2"
pytest-asyncio = "==0.17.2"
pytest-asyncio = "==0.14.0"
pytest-pythonpath = "*"
black = "*"
black = "==20.8b1"

[packages]
aimmo-game = {editable = true,path = "."}
docker = "*"
eventlet = "*"
google-api-python-client = "*"
google-cloud-logging = "*"
kubernetes = "*"
aiohttp = "==3.7.4"
docker = "==4.4.4"
eventlet = "==0.31.0"
google-api-python-client = "==1.12.8"
google-cloud-logging = "==2.2.0"
kubernetes = "==12.0.1"
python-socketio = "5.0.3"

[requires]
Expand Down
Loading

0 comments on commit 799dce1

Please sign in to comment.