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

Handle dockerfile in build strategy conversion #1381

Merged

Conversation

SaschaSchwarze0
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 commented Sep 14, 2023

Changes

This change completes the handling of Dockerfiles:

  • When a Beta build contains a Dockerfile parameter, then this is converted to .spec.dockerfile in Alpha without adding the parameter
  • An Alpha build strategy that uses $(build.dockerfile) or $(params.DOCKERFILE) gets their usage migrated to $(params.dockerfile) and the dockerfile parameter is declared
  • A Beta build strategy that declares a dockerfile parameter as string with Dockerfile as default value gets this parameter removed and all referenced changed to $(params.DOCKERFILE)
    I am also adding a commit that fixes the conversion of the retention from alpha to beta. The old code worked find in unit tests but not in reality. We must create a copy of the Map so that the annotation addition works.

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Set a kind label on this PR
  • Release notes block has been filled in, or marked NONE

Release Notes

NONE

@SaschaSchwarze0 SaschaSchwarze0 added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 14, 2023
@SaschaSchwarze0 SaschaSchwarze0 added this to the release-v0.12.0 milestone Sep 14, 2023
@openshift-ci openshift-ci bot added the release-note-none Label for when a PR does not need a release note label Sep 14, 2023
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 14, 2023
@openshift-ci openshift-ci bot requested a review from HeavyWombat September 14, 2023 19:08
Copy link
Contributor

@qu1queee qu1queee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the enhancement!

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 19, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 19, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qu1queee

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 19, 2023
if usesDockerfile {
src.Parameters = append(src.Parameters, Parameter{
Name: "dockerfile",
Description: "The Dockerfile to be built.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@openshift-merge-robot openshift-merge-robot merged commit ed489b6 into shipwright-io:main Sep 19, 2023
11 checks passed
@SaschaSchwarze0 SaschaSchwarze0 deleted the sascha-dockerfile branch September 19, 2023 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note-none Label for when a PR does not need a release note size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants