Skip to content

Commit

Permalink
chore: Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Batalex committed Jan 6, 2025
1 parent ef9e956 commit d107854
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/managers/k8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def apply_service(self, service: Service) -> None:
if e.status.code == 403:
logger.error("Could not apply service, application needs `juju trust`")
return
if e.status.code == 422 and "port is already allocated" in e.status.message:
if e.status.code == 422 and "port is already allocated" in str(e.status.message):
logger.error(e.status.message)
return
else:
Expand Down Expand Up @@ -190,7 +190,7 @@ def get_nodeport(self, auth: Literal["plain", "tls"]) -> int:
raise Exception("Could not find Service spec or ports")

for port in service.spec.ports:
if str(port.name).endswith(auth):
if str(port.name).endswith(auth) and isinstance(port.nodePort, int):
return port.nodePort

raise Exception(f"Unable to find NodePort using {auth} for the {service} service")
Expand Down

0 comments on commit d107854

Please sign in to comment.