()
Looks up the agent's kubernetes_pod_expiration_duration option and returns either:
          - None if expiration is disabled (set to 0)
          - A (timezone aware) datetime object to compare against
Looks up the agent's kubernetes_pod_expiration_duration option and returns either:
          - None if expiration is disabled (set to 0)
          - A (timezone aware) datetime object to compare against
Looks up the agent s kubernetes_pod_expiration_duration option and returns either : - None if expiration is disabled ( set to 0 ) - A ( timezone aware ) datetime object to compare against
def compute_pod_expiration_datetime():
        """
        Looks up the agent's kubernetes_pod_expiration_duration option and returns either:
          - None if expiration is disabled (set to 0)
          - A (timezone aware) datetime object to compare against
        """
        try:
            seconds = int(get_config("kubernetes_pod_expiration_duration"))
            if seconds == 0:  # Expiration disabled
                return None
            return datetime.utcnow().replace(tzinfo=UTC) - timedelta(seconds=seconds)
        except (ValueError, TypeError):
            return None
def compute_pod_expiration_datetime ( ) : try : seconds = int ( get_config ( "kubernetes_pod_expiration_duration" ) ) if seconds == 0 : # Expiration disabled return None return datetime . utcnow ( ) . replace ( tzinfo = UTC ) - timedelta ( seconds = seconds ) except ( ValueError , TypeError ) : return None