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

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

Open
1 task done
adambkaplan opened this issue Nov 5, 2024 · 2 comments
Open
1 task done
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@adambkaplan
Copy link
Member

adambkaplan commented Nov 5, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Kubernetes Version

1.29

Shipwright Version

v0.13.0

Current Behavior

If we create a build requiring git credential before creating the secret and we create the secret after build creation, the build cannot start.

Expected Behavior

We should be able to run a build after the referenced secret.git.cloneSecret has been created.

Steps To Reproduce

  1. Create a Build object that references a git clone secret that does not exist yet.
  2. Create the referenced source clone secret.
  3. Attempt to execute a BuildRun from this Build.

Build cannot run because the parent Build has the "unregistered" status.

Anything else?

Reported in Red Hat JIRA - https://issues.redhat.com/browse/BUILD-1160

@adambkaplan adambkaplan added the kind/bug Categorizes issue or PR as related to a bug. label Nov 5, 2024
@SaschaSchwarze0
Copy link
Member

@adambkaplan today, we reconcile Builds only for secret operations if the secret is annotated with build.shipwright.io/referenced.secret=true. See for the code logic: https://github.com/shipwright-io/build/blob/main/pkg/reconciler/build/controller.go#L160. Documentation is here: https://github.com/shipwright-io/build/blob/main/docs/development/authentication.md#build-secrets-annotation

Though, I would not be against changing this. Given this all operates on caches, we could always retrieve all builds when a secret gets created or deleted and reconcile either all of them or only those that have a reference to the secret.

@adambkaplan
Copy link
Member Author

Though, I would not be against changing this. Given this all operates on caches, we could always retrieve all builds when a secret gets created or deleted and reconcile either all of them or only those that have a reference to the secret.

Agree that it makes sense to remove. This feels like a performance optimization we did in the early days of the project. Since we now have very strong caching in place, those list operations are very low cost, even at scale.

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

No branches or pull requests

2 participants