---
settings: (( &temporary ))
landscape: (( &temporary ))
env: (( &temporary ))

wait_for_certificate:
  <<: (( &temporary ))
  check_command: 
    - "kubectl"
    - "--kubeconfig"
    - (( lookup_file(landscape.clusters.[0].kubeconfig, env.ROOTDIR).[0] ))
    - "-n"
    - (( .settings.certificate.namespace ))
    - "get"
    - "certificate.cert-manager.io"
    - (( .settings.certificate.name ))
    - "-o"
    - "json"
  result: (( sync( exec_uncached( check_command ), defined( value.status.conditions[0].status ) -and value.status.conditions[0].status == "True", value, 600 ) ))
  b64dall: (( |x|-> sum[x|{}|s,k,v|-> s {k=base64_decode(v)}] ))

export:
  <<: (( .settings ))
