-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
How can feature flags in the provenance better reflect the execution of the pipeline run? #6797
Comments
Thanks Chitrang! Just want to note one additional comment you made: "The feature flags in the provenance... assumes that both pipeline and pipelinerun were validated with the same set of feature flags". Currently, Pipelines are validated on creation and again when they are used in PipelineRuns. Feature flags might have changed since pipeline creation, but the value of feature flags when the pipelinerun is executed should reflect what was used to validate the pipeline spec. The one exception is "enable-api-fields" as of #6701. |
The idea of a mutating admission webhook seems reasonable to me. |
This is indeed true, but is it something we want to disallow or not ? We probably want to dissallow, a bit similar to the "spec" of a
What does In code we can use
This is what the "defaulting" admission controller does today yes.
This would be very slippery to do, as essentially, this would mean the
Definitely yes.
It shouldn't be possible to create an object with an already populated I think the "worry" here is that we could create a This is the behaviour today, and there is little we can do about it really. I do think we should adopt the simplest path (both for users and implementation). We need to decouple (in our head) the
With the proposed suggestion above, the existing defaulting admission controller could set those "feature flag" value per object (let's say, using annotations), and the controllers (PipelineRun and TaskRun) would rely on those. And if not present, rely on the configmap, as it works today. Also one thing to note : we do not expect users to change feature-flags on a regular basis 👼🏼 |
Thanks for your feedback @vdemeester!!
Yes, I meant
Yes, I also feared this case also from the side of performance (ie. querying the parent object every reconcile loop).
I agree, I tried creating a taskrun with a status but it did not work. The status of the created taskrun did not have what I had populated.
I think the worry here is more, mutating the feature flags in the middle of the pipeline run. Basically, we cannot guarantee that the feature flags in the
I did think of using annotations earlier but the challenge is the the annotations can be modified. If we embed these in the status, then we can use
|
Another possible solution: What if we create a new This way, only the operators with privilege to update the config maps can actually modify it in the middle of the run. The end users cannot fake them into the provenance. |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
/remove-lifecycle rotten |
Considering the use case of a pipelineRun for this issue (same applies to the taskrun as well).
Feature-flags are used by the validation web hook and the reconciler to guard the API spec usage. We currently store them in the
PipelineRun.Status.Provenance
field. The feature-flags are used by Tekton Chains and stored in the generated provenance to indicate that the pipelinerun (or the build) was executed with these feature-flags. However, the feature-flags can be updated on the fly by updating theconfigMap
. If this happens mid-way during the build process, the information surfaced in the provenance is incomplete because the flags were mutated during the pipeline run. This means that some pipeline tasks could have run with a different set of feature flags.Proposed solutions in Issue #5999 suggested the use of the
status
field instead of context.The challenge was as follows:
webhook
andreconciler
.feature flags
are saved in thestatus
of thetaskrun/pipelinerun
then when we validate astand-alone pipelineSpec/taskSpec
(particularly at thewebhook
stage), thistaskrun/pipelinerun status
field is not accessible and so we cannot rely on it. Thestatus
idea would work if we were only validating at the reconciler level.context
. Now, the challenge here is that thewebhook
andcontroller
watches for updates to theconfig map
and thecontext
is updated when changes are detected (I think. Please correct me if I'm wrong). This means that we cannot rely on the context directly as well.This issue is to brainstorm about how the feature flags in the provenance can better reflect the execution of the pipeline run.
The text was updated successfully, but these errors were encountered: