Comments (14)
I will work on this feature now.
from build.
Hi @sbose78 ,
I did some investigations today. I think there are two ways to add the ownerreference for the new created buildRun.
1. Use mutating admission webhook.
But I think, we just need to add ownerreference for buildRun, add a new wekhook deployment and build process just for this ONE ownerreference requirement is too HEAVY now
2, Set the ownerreference in buildRun controller first.
When a new buildRun is created, buildRun controller notice that and add the ownerreference at the beginning of controller reconcile logic.
Such as add:
ownerReferences:
- apiVersion: build.dev/v1alpha1
blockOwnerDeletion: true
controller: true
kind: Build
name: buildpack-nodejs-build
uid: 9b197859-7bdf-4d58-ac47-f7aea2564bbd
to this buildRun. And I have checked, the generation won't be increased if I add this ownerreference. So we can add it safely in the controller logic and update the ownerreference in the buildRun controller logic.
I prefer to use the second way because it is easy and less dependencies.
But I don't know what we plan to implement in the issue Validate the Build on creation
(#83)
Will we introduce the validating webhook to do that? (Also FYI @qu1queee )
If yes, we can also introduce the mutating webhook for the ownerreference together.
If we don't plan to use webhook for validation too. I think we can use option 2.
Any idea, all?
Thanks!
from build.
Stay away from webhooks as much as possible ;)
So, yes, the second one is better.
from build.
Agree. Let me try the second way first. :)
from build.
I have a design question though. If I delete the build configuration and all buildruns also get removed, would that lead to loss of trace-ability of complete|successful|failed builds ?
from build.
How do you do in the build v1?
If the end-user deletes the BuildConfig
, will you also delete the related Builds
in build v1 now?
Will those buildRuns
to be the orphan resources if we don't delete them together?
from build.
Yes, in Build v1, they were ownerRef'd. Yeah, they will be orphan resources for sure - but I'm wondering if there's a good reason for having them stick around 🤔.
( you can go ahead with the changes - I was thinking out aloud..)
from build.
em..... I just had a try on OpenShift v4.x.
Interesting, there is a dialog pop up when you want to delete a BuildConfig:
Delete Build Config
Delete dotnet?
Are you sure you want to delete dotnet in namespace default?
[x] Delete dependent objects of this resource
- If you choose
Delete dependent objects of this resource
, the Builds will be deleted together. - If you don't choose
Delete dependent objects of this resource
, the Builds will be kept
So..... should we add the logic in Build controller?
- If there is any parameter (like a new annotation) from UX to ask to delete dependencies, then query all related resources and delete them?
from build.
Yeah, the annotation path looks good. Maybe we label the buildRuns in a way that they are easy to look up?
from build.
- Add
annotation path
anddelete logic
in Build controller - Add label for buildRuns in buildRun controller reconcile at the beginning if it doesn't exist
How about this way? :)
from build.
Add annotation path and delete logic in Build controller
While handling deletion, check if there's an annotation that says "don't delete BuildRuns. If present, then skip deletion of BuildRuns.
Add label for buildRuns in buildRun controller reconcile at the beginning if it doesn't exist
Helps us query, yes.
Is that what you had in mind?
from build.
yes, that is my point.
from build.
Sounds good, Jordan!
from build.
this is done , closing
from build.
Related Issues (20)
- [FEATURE] Move Readme Try It Section to BETA HOT 5
- [FEATURE] v0.13 Bump Tekton and Kubernetes dependencies
- [FEATURE] Document usage of OCIArtifact source type HOT 2
- [BUG] Endless reconcile of build when strategy kind is unknown
- [SHIP-0038] Use Release Branches for Releasing HOT 4
- [tech-debt] Release Workflow Action No Longer Maintained
- [BUG] BuildStrategy: Cannot Use Context Dir as Working Directory HOT 4
- [FEATURE] Conditional step HOT 1
- [FEATURE] Build Strategy from Tekton Task/Pipeline HOT 1
- [BUG] Automatic release README update needs to be fixed HOT 4
- [FEATURE] Provide Storage Version Migration from v1alpha1 to v1beta1 HOT 1
- [BUG] git clone issue on newest Git version HOT 3
- [FEATURE] Windows Containers/Node Support HOT 2
- [FEATURE] Support another technology to define and orchestrate the image creation inside a pod HOT 2
- [BUG] Unit tests run fine with `go test`, but fail when used with Ginkgo CLI HOT 1
- SHIP-0039: Allow node selector on `Build` and `BuildRun` to be set HOT 7
- SHIP-0039: Allow tolerations on `Build` and `BuildRun` to be set
- SHIP-0039: Allow custom scheduler to be used for `Build` and `BuildRun`
- [FEATURE] Establish a release cadence based on Tekton LTS releases HOT 2
- [BUG] The container name for shipwright build webhook doesn't match the environment variable HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from build.