Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug with accessing hooks in EKS trigger #35989

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading