Try block on JOBS


#1

How can i make the following job return Successful everytime?
I am catching the failure and on_failure make sure the resource is created if it is not found in first place.

jobs:

  • name: Build & Verify Namespaces
    plan:
    • put: Get Namespace
      resource: kubernetes-resource
      params:
      kubectl: get namespace {{namespace}}
      wait_until_ready: 10
      on_failure:
      do:
      • put: Create Namespace
        resource: kubernetes-resource
        params:
        kubectl: create namespace {{namespace}}
        wait_until_ready: 10