Skip to content

Commit

Permalink
Fix a bug with accessing hooks in EKS trigger (#35989)
Browse files Browse the repository at this point in the history
  • Loading branch information
hussein-awala authored Nov 30, 2023
1 parent a9132f3 commit 8346fd5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions airflow/providers/amazon/aws/triggers/eks.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def hook(self) -> AwsGenericHook:
return EksHook(aws_conn_id=self.aws_conn_id, region_name=self.region_name)

async def run(self):
async with self.hook.async_conn as client:
async with self.hook().async_conn as client:
waiter = client.get_waiter("cluster_deleted")
if self.force_delete_compute:
await self.delete_any_nodegroups(client=client)
Expand Down Expand Up @@ -148,10 +148,7 @@ async def delete_any_nodegroups(self, client) -> None:
nodegroups = await client.list_nodegroups(clusterName=self.cluster_name)
if nodegroups.get("nodegroups", None):
self.log.info("Deleting nodegroups")
# ignoring attr-defined here because aws_base hook defines get_waiter for all hooks
waiter = self.hook.get_waiter( # type: ignore[attr-defined]
"all_nodegroups_deleted", deferrable=True, client=client
)
waiter = self.hook().get_waiter("all_nodegroups_deleted", deferrable=True, client=client)
for group in nodegroups["nodegroups"]:
await client.delete_nodegroup(clusterName=self.cluster_name, nodegroupName=group)
await async_wait(
Expand Down

0 comments on commit 8346fd5

Please sign in to comment.