You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/12/14 03:12:21 UTC
[GitHub] [airflow] ferruzzi edited a comment on issue #19641: EKSCreateNodegroupOperator - missing kwargs
ferruzzi edited a comment on issue #19641:
URL: https://github.com/apache/airflow/issues/19641#issuecomment-993113732
How do we feel about this implementation? The required parameters are still there in named args, but if they are not passed, then it checks the operator_kwargs for their values. So all three of these are valid:
Pass only the required values by name:
```
create_nodegroup = EKSCreateNodegroupOperator(
task_id='create_eks_nodegroup',
cluster_name=cluster_name,
nodegroup_name=node_group_name,
nodegroup_subnets=get_subnets(),
nodegroup_role_arn=get_node_role(),
)
```
Pass the required values by name and the optional values in an operator_kwargs
```
create_nodegroup = EKSCreateNodegroupOperator(
task_id='create_eks_nodegroup',
cluster_name=cluster_name,
nodegroup_name=node_group_name,
nodegroup_subnets=get_subnets(),
nodegroup_role_arn=get_node_role(),
create_nodegroup_kwargs={
amiType = "BOTTLEROCKET_x86_64",
instanceTypes = "t3.large",
capacityType = "ON_DEMAND"
}
)
```
Pass everything in as operator_kwargs:
```
create_nodegroup = EKSCreateNodegroupOperator(
task_id='create_eks_nodegroup',
create_nodegroup_kwargs={
cluster_name=cluster_name,
nodegroup_name=node_group_name,
nodegroup_subnets=get_subnets(),
nodegroup_role_arn=get_node_role(),
amiType = "BOTTLEROCKET_x86_64",
instanceTypes = "t3.large",
capacityType = "ON_DEMAND"
}
)
```
https://github.com/ferruzzi/airflow/tree/kwargs-kpo
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org