Skip to content

fix: preserve BuildRun output insecure and timestamp on conversion - #2305

Merged
openshift-merge-bot[bot] merged 1 commit into
shipwright-io:mainfrom
Ryntak94:fix/buildrun-output-conversion-2303
Aug 25, 2026
Merged

fix: preserve BuildRun output insecure and timestamp on conversion#2305
openshift-merge-bot[bot] merged 1 commit into
shipwright-io:mainfrom
Ryntak94:fix/buildrun-output-conversion-2303

Conversation

@Ryntak94

@Ryntak94 Ryntak94 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Changes

The BuildRun conversion webhook built the output Image struct with only Image, Annotations and Labels before attaching the push secret, so .spec.output.insecure and .spec.output.timestamp were silently dropped in both directions. Both fields exist in the Image type in v1alpha1 and v1beta1, and the equivalent Build conversion already carries them (build_conversion.go L201/L208 and L294/L301) — so a Build round-tripped its output settings intact while a BuildRun overriding the same settings lost them.

A user setting output.insecure to push to an insecure registry, or output.timestamp for a reproducible image timestamp, on a BuildRun had that override discarded without warning once the object passed through conversion, and the build ran with different output settings than requested.

This copies both fields in ConvertTo and ConvertFrom, mirroring the Build conversion, and adds conversion webhook specs covering the BuildRun output in both directions.

Related Issue

Fixes #2303

Type of PR

/kind bug

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing — no API surface or documented behaviour changes; the fix makes existing documented fields behave as documented
  • Kind label has been set
  • Release notes block has been filled in, or marked NONE

Release Notes

Fixed BuildRun conversion silently dropping `.spec.output.insecure` and `.spec.output.timestamp`. Both fields are now preserved when a BuildRun is converted between v1alpha1 and v1beta1, matching the existing Build conversion behaviour.

The BuildRun conversion webhook built the output Image struct with only
image, annotations and labels before attaching the push secret, so
.spec.output.insecure and .spec.output.timestamp were silently dropped
in both directions. Both fields exist in the Image type in v1alpha1 and
v1beta1, and the equivalent Build conversion already carries them.

A user setting output.insecure to push to an insecure registry, or
output.timestamp for a reproducible image timestamp, on a BuildRun had
that override discarded without warning once the object passed through
conversion, and the build ran with different output settings than
requested.

Copy both fields in ConvertTo and ConvertFrom, mirroring the Build
conversion, and add conversion webhook specs covering the BuildRun
output in both directions.

Closes shipwright-io#2303

Signed-off-by: Ryan Matthews <ryan.matthews.professional@gmail.com>
@openshift-ci openshift-ci Bot added release-note Label for when a PR has specified a release note do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Aug 25, 2026
@pull-request-size pull-request-size Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 25, 2026
@openshift-ci openshift-ci Bot added the kind/bug Categorizes issue or PR as related to a bug. label Aug 25, 2026
@Ryntak94
Ryntak94 marked this pull request as ready for review August 25, 2026 03:10
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 25, 2026
@openshift-ci
openshift-ci Bot requested review from qu1queee and rxinui August 25, 2026 03:10
@Ryntak94

Copy link
Copy Markdown
Contributor Author

Heads up for reviewers: #2306 (the deprecated .status.failedAt fix, #2304) is stacked on this PR. Both touch buildrun_conversion.go and converter_test.go, so I rebased that branch on top of this one to keep them conflict-free — which means #2306's diff currently also shows this PR's commit.

Merging this one first is the cleaner order; once it lands, #2306 reduces to its own single commit.

@SaschaSchwarze0 SaschaSchwarze0 added this to the release-v0.21.0 milestone Aug 25, 2026

@SaschaSchwarze0 SaschaSchwarze0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/approve
/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 25, 2026
@openshift-ci

openshift-ci Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SaschaSchwarze0

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

The pull request process is described here

Details 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 Aug 25, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit 3499ed0 into shipwright-io:main Aug 25, 2026
24 of 26 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Issues Aug 25, 2026
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/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Label for when a PR has specified a release note size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[BUG] BuildRun conversion drops .spec.output.insecure and .spec.output.timestamp

3 participants