Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Conditional step #1577

Open
1 task done
cmoulliard opened this issue Apr 15, 2024 · 1 comment
Open
1 task done

[FEATURE] Conditional step #1577

cmoulliard opened this issue Apr 15, 2024 · 1 comment
Labels
discussion kind/feature Categorizes issue or PR as related to a new feature. ship-required

Comments

@cmoulliard
Copy link

Is there an existing feature request for this?

  • I have searched the existing feature requests

Is your feature request related to a problem or use-case? Please describe.

As a user, I would like that a step is executed according to a matching condition or not

Such a use case exists typically when we do a buildpacks build as since the release 0.10 of the platform spec it is possible to execute the step "extension" (see step description: https://github.com/buildpacks/spec/blob/main/buildpack.md#phase-4-extension-image-extensions-only) or the step "build".

Using Tekton, such condition can be declared as such:

// https://github.com/redhat-buildpacks/catalog/blob/main/tekton/pipeline/buildpacks/01/buildpacks.yaml#L72-L76

    - name: buildpacks
      when:
        - input: $(tasks.buildpacks-extension-check.results.extensionLabels)
          operator: in
          values: ["empty"]
      taskRef:
        name: buildpacks-phases
        
 or

    - name: buildpacks-extension
      when:
        - input: $(tasks.buildpacks-extension-check.results.extensionLabels)
          operator: notin
          values: ["empty"]
      taskRef:
        name: buildpacks-extension-phases       

Describe the solution that you would like.

The (cluster)buildstrategy should include a when statement where user can declare the condition to be matched to execute or not the step

Describe alternatives you have considered.

No response

Anything else?

No response

@adambkaplan
Copy link
Member

This approach warrants further discussion, and the API update would be significant enough that it should be formally described in a SHIP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion kind/feature Categorizes issue or PR as related to a new feature. ship-required
Projects
Status: No status
Development

No branches or pull requests

2 participants