Skip to content

Document how to use failwhen to revert condition expected result #649

@olblak

Description

@olblak

Summary

While answering this updatecli/updatecli#1137
I noticed that it's not obvious how to revert condition result

Basic example

conditions:
  jenkinsexist:
    name: Expect condition to succeed as Jenkins version exist
    kind: jenkins
    spec:
      version: '2.235'
      release: weekly
    failwhen: false
  jenkindonotexist:
    name: Expect condition to fail due to failwhen even if Jenkins version exist
    kind: jenkins
    spec:
      version: '2.235'
      release: weekly
    failwhen: true
  wrongjenkinsexist:
    name: Expect condition to fail as Jenkins version do not exist
    kind: jenkins
    spec:
      version: '2.999'
      release: weekly
    failwhen: false
  wrongjenkindonotexist:
    name: Expect condition to success due to failwhen even if Jenkins version do not exist
    kind: jenkins
    spec:
      version: '2.999'
      release: weekly
    failwhen: true

Motivation

Why are we doing this? What use cases does it support? What is the expected outcome?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions