shipwright-io / build

Shipwright - a framework for building container images on Kubernetes
https://shipwright.io
Apache License 2.0
654 stars 111 forks source link

Do not set dockerfile parameter to an empty string to align with behavior of alpha controller #1569

Closed SaschaSchwarze0 closed 6 months ago

SaschaSchwarze0 commented 6 months ago

Changes

When the Build controller still reconciled the Alpha version of Builds, it handled spec.dockerfile here: https://github.com/shipwright-io/build/blob/v0.12.0/pkg/reconciler/buildrun/resources/taskrun.go#L361-L369.

Basically if the value was nil, the parameter value was not added. With that, its default value, "Dockerfile" was used. https://github.com/shipwright-io/build/blob/v0.12.0/pkg/reconciler/buildrun/resources/taskrun.go#L74-L81

Suddenly, this was also happening when the spec.dockerfile was set to an empty string.

To mimic the same behavior with the conversion to Beta, I am changing our conversion code to behave the same = not adding the parameter value to be an empty string.

Submitter Checklist

Release Notes

An Alpha Build where `spec.dockerfile` is set to `""`, is now transformed to a Beta Build without the dockerfile parameter to behave like in Alpha
HeavyWombat commented 6 months ago

/approve

openshift-ci[bot] commented 6 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: HeavyWombat

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: - ~~[OWNERS](https://github.com/shipwright-io/build/blob/main/OWNERS)~~ [HeavyWombat] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
adambkaplan commented 5 months ago

/cherrypick release-v0.13

openshift-cherrypick-robot commented 5 months ago

@adambkaplan: new pull request created: #1591

In response to [this](https://github.com/shipwright-io/build/pull/1569#issuecomment-2093618547): >/cherrypick release-v0.13 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.