Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
Signed-off-by: Flynn <[email protected]>
  • Loading branch information
kflynn committed Dec 5, 2024
1 parent 95495a5 commit d0e902d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions python/ambassador/envoy/v3/v3route.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,11 @@ def action_route(self, variant) -> None:
def action_redirect(self, variant) -> None:
variant.pop("route", None)
variant["redirect"] = {"https_redirect": True}
for filter in self.route._group.ir.filters:

# Sometimes mypy has trouble with inferring this type?
group: IRHTTPMappingGroup = self.route._group

for filter in group.ir.filters:
if filter.kind == "IRAuth":
# Required to ensure that the redirect occurs prior to calling ext_authz
# when an AuthService is applied
Expand Down Expand Up @@ -281,7 +285,12 @@ def __init__(
envoy_route = EnvoyRoute(group).envoy_route

mapping_prefix = mapping.get("prefix", None)
route_prefix = mapping_prefix if mapping_prefix is not None else group.get("prefix")
# We'll go ahead and cast this to a str because the prefix is a required field
# in the Mapping CRD, so we should definitely have a string in the Mapping or
# in the group.
route_prefix = typecast(
str, mapping_prefix if mapping_prefix is not None else group.get("prefix")
)

mapping_case_sensitive = mapping.get("case_sensitive", None)
case_sensitive = (
Expand Down

0 comments on commit d0e902d

Please sign in to comment.