dstandish commented on code in PR #20578:
URL: https://github.com/apache/airflow/pull/20578#discussion_r878536394
##########
airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py:
##########
@@ -561,6 +569,39 @@ def dry_run(self) -> None:
pod = self.build_pod_request_obj()
print(yaml.dump(prune_dict(pod.to_dict(), mode='strict')))
+ def _patch_deprecated_k8s_settings(self, hook: KubernetesHook):
+ """
+ Here we read config from core Airflow config [kubernetes] section.
+ In a future release we will stop looking at this section and require
users
+ to use Airflow connections to configure KPO.
+
+ When we find values there that we need to apply on the hook, we patch
special
+ hook attributes here.
+ """
+
+ # default for enable_tcp_keepalive is True; patch if False
+ if conf.getboolean('kubernetes', 'enable_tcp_keepalive',
fallback=None) is False:
Review Comment:
if the value is missing from the config and you don't have a fallback, it
would throw an error.
as to why None, well, just a reasonable default that means "not set". Only
when it's explicitly set to False would we want to set the hook to disable TCP
keepalive.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]