-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Refactor Eks Create Cluster Operator code #31960
Refactor Eks Create Cluster Operator code #31960
Conversation
self.eks_hook = EksHook(aws_conn_id=self.aws_conn_id, region_name=self.region) | ||
super().__init__(**kwargs) | ||
|
||
def create_compute(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def create_compute(self): | |
def create_compute(self) -> None: |
And now Mypy would start to prompt you adding variable definitions on the class (which is good)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this change, and it ended up having a bigger impact than I anticipated. I had to add a bunch of parameters used in the 3 child classes. I think I've got everything ready. I need to do some testing with how templating works here. Right now, _BaseEksCreateOperator
doesn't have any templated fields, but because the child classes allow templating for some parameters, I think I have to do the same for _BaseEksCreateOperator
.
@uranusjr what do you think?
Looks like there’s a coverage error. Maybe caused by the base class name change? |
Add waiter params to EksCreateClusterOperator and EksCreateNodegroupOperator Update EksCreateFargateProfileTrigger and EksDeleteFargateProfileTrigger to use more consistent waiter names Update unit tests for triggers and operators
…is meant to be a parent class to some of the Eks operators
Minor PR comment fixes
e1c2a92
to
745c57a
Compare
* Refactor EksCreateClusterOperator to reuse code being used in multiple places * Update create_compute method to pass tests Add waiter params to EksCreateClusterOperator and EksCreateNodegroupOperator Update EksCreateFargateProfileTrigger and EksDeleteFargateProfileTrigger to use more consistent waiter names Update unit tests for triggers and operators
The
EksCreateClusterOperator
is capable of creating a Fargate Profile or Nodegroup that is associated with the newly created cluster. The code for creating the Fargate Profile and Nodegroup is the same as the code inEksCreateFargateProfileOperator
andEksCreateNodegroupOperator
respectively.This PR refactors the code to reuse some of the code to decrease code duplication. This step also simplifies adding deferrable mode to these operators.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.