Skip to content

FIX: Allow builds to reconcile even if the secret doesn't have build.shipwright.io/referenced.secret=true annotation #2175

Open
kaizakin wants to merge 4 commits intoshipwright-io:mainfrom
kaizakin:fix/build-reconcile-on-secret-creation
Open

FIX: Allow builds to reconcile even if the secret doesn't have build.shipwright.io/referenced.secret=true annotation #2175
kaizakin wants to merge 4 commits intoshipwright-io:mainfrom
kaizakin:fix/build-reconcile-on-secret-creation

Conversation

@kaizakin
Copy link
Copy Markdown
Contributor

@kaizakin kaizakin commented Apr 30, 2026

Changes

  • updated the controller to reconcile builds even if the secret is created without the build.shipwright.io/referenced.secret=true annotation
  • added depreciation comments on the API definition
  • removed redundant tests and updated tests to use SecretWithoutAnnotation
  • removed Build secret annotation section from the docs since that is not needed anymore.

Edit:

  • since the flagReconcile was declared outside the loop and is never reset to false, once a build is referenced by the secret causing all subsequent builds to be falsely queued. updated that as well.

tested it in my local kind cluster

⇛ k apply -f build.yaml
build.shipwright.io/kaniko-golang-build created
⇛ k get builds
NAME                   REGISTERED   REASON                        BUILDSTRATEGYKIND      BUILDSTRATEGYNAME   CREATIONTIME
kaniko-golang-build   False        SpecSourceSecretRefNotFound   ClusterBuildStrategy   kaniko              4s
⇛ k apply -f git-basic-secret.yaml
secret/git-basic-secret created
⇛ k get builds
NAME                   REGISTERED   REASON      BUILDSTRATEGYKIND      BUILDSTRATEGYNAME   CREATIONTIME
kaniko-golang-build   True         Succeeded   ClusterBuildStrategy   kaniko              39s

once the secret is created build automatically reconciles and unregistered build now registers successfully.

Related Issue

Fixes #1725

Type of PR

/kind cleanup
/kind documentation

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Kind label has been set
  • Release notes block has been filled in, or marked NONE

Release Notes

Allow builds to reconcile even if the secret doesn't have `build.shipwright.io/referenced.secret=true` annotation

@openshift-ci openshift-ci Bot added release-note Label for when a PR has specified a release note kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Apr 30, 2026
@pull-request-size pull-request-size Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 30, 2026
@openshift-ci openshift-ci Bot added the kind/documentation Categorizes issue or PR as related to documentation. label Apr 30, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 30, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign heavywombat for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

kaizakin added 4 commits May 1, 2026 03:24
update build selection logic

Signed-off-by: karthik balasubramanian <karthikbalasubramanian08@gmail.com>
…use secrets without annotations

Signed-off-by: karthik balasubramanian <karthikbalasubramanian08@gmail.com>
… context

Signed-off-by: karthik balasubramanian <karthikbalasubramanian08@gmail.com>
Signed-off-by: karthik balasubramanian <karthikbalasubramanian08@gmail.com>
@kaizakin kaizakin force-pushed the fix/build-reconcile-on-secret-creation branch from cee2810 to 5b1350f Compare April 30, 2026 21:59
Copy link
Copy Markdown
Member

@IrvingMg IrvingMg left a comment

Choose a reason for hiding this comment

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

I haven’t looked at the code in detail yet, but from the description it seems that this PR not only fixes the bug, but also makes the annotation no longer useful.

I’m not sure if this should be considered an API change, but it feels a bit aggressive since it changes behavior while fixing the bug.

Maybe it would be better to first focus only on the bug fix, and handle the annotation change separately. What do you think?

That said, I don’t have a strong opinion, so it would be good to get feedback from others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/documentation Categorizes issue or PR as related to documentation. 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: No status

Development

Successfully merging this pull request may close these issues.

[BUG] Build Remains "unregistered" After Git Clone Secret is Created

3 participants