pipeline
pipeline copied to clipboard
Add v1beta1 version of CustomRun CRD
Changes
This commit adds a v1beta1 version of the CustomRun CRD, and support to the webhook.
Fixes issue #5154 Fixes issue #5153 Fixes issue #5532
/cc @jerop /kind misc
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
- n/a Has Docs included if any changes are user facing
- n/a Has Tests included if any functionality added or changed
- [x] Follows the commit message standard
- [x] Meets the Tekton contributor standards (including functionality, content, code)
- [x] Has a kind label. You can add one by adding a comment on this PR that contains
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep - [x] Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
- n/a Release notes contains the string "action required" if the change requires additional action from users switching to the new release
Release Notes
NONE
Hi @vsinghai. Thanks for your PR.
I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test
on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test
label.
I understand the commands that are listed here.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
do I need conversions
, like stated here, for v1alpha1.Runs to v1beta1.CustomRuns?
/assign
do I need
conversions
, like stated here, for v1alpha1.Runs to v1beta1.CustomRuns?
From the API compatibility policy perspective, it's okay that we don't convert it (per Rule #2
in K8s API Deprecation Policy) (meaning we deprecate the entire alpha track of the Custom Task Run).
The reason that PipelineRun needs that conversion is we want to support both v1beta1 and v1 version at the same time.
/ok-to-test
do I need
conversions
, like stated here, for v1alpha1.Runs to v1beta1.CustomRuns?From the API compatibility policy perspective, it's okay that we don't convert it (per
Rule #2
in K8s API Deprecation Policy) (meaning we deprecate the entire alpha track of the Custom Task Run).The reason that PipelineRun needs that conversion is we want to support both v1beta1 and v1 version at the same time.
I think we would ideally like to have conversion here because it will allow us to support v1alpha1 Runs and v1beta1 CustomRuns at the same time. Technically it's not necessary since v1alpha1 Run is in alpha but it feels a bit user hostile to drop support for Runs at the same time we're adding support for CustomRuns. It will force people to copy all their Run definitions somewhere, delete them, upgrade tekton pipelines, and then recreate their old run definitions as CustomRuns. (This would also be the case if we rename the "Kind" of the existing CRD to "CustomRun".)
Unfortunately I'm not sure if there's an easy way to rename a CRD/implement conversion between two different "Kinds". One thing we could try is to add a v1beta1 version of Run that deserializes to the CustomRun go struct, in addition to adding a CustomRun CRD with a v1beta1 version, and probably deprecate the Run CRD after giving people a release or two to convert to the new CRD. (I'm not totally sure if this would work)
Another idea would be to have the new CRD and update the pipelinerun reconciler code to allow reconciling both v1alpha1 Runs and v1beta1 custom runs, and not implement conversion. We would probably want to remove support for v1alpha1 runs after a release or two. I'm fairly sure this would work.
happy to help here but want to hear others' thoughts first -- @tektoncd/core-maintainers is this making sense/do you know how to rename a CRD?
I've never actually seen anyone rename a CRD - I'm pretty sure you can't convert between two different Kind
s, yeah. Some research is definitely needed here.
I would say the main focus is how do we want our users to conceive the "alpha" feature.
IMHO alpha version track is designed to serve as experimental features, meaning we really don't want our users to rely on alpha features in their prod env. They are only suppose to use it for experiments and they should expect the alpha features can be different, backward incompatible across two adjacent releases.
However, IIUC, this "alpha" feature has existed for a long time and some users have already heavily relied on it (have they?), we can't ignore this real life situation, in this case, I strongly recommend we need to support both for a while, giving them enough buffer time to migrate.
But in order to form a formal standard around stability of each version track, I would suggest it might be better if we explicitly tell users that supporting both alpha and beta versions this time is an exception, this decision is not based on the guidance we'd like to follow, but based on the reality that we haven't been actively promoting alpha features to beta in the past. While we are planning to do it in the future.
Thanks for the great conversation @lbernick @XinruZhang @abayer . I would like to ask a couple of questions regarding this situation. To my understanding, v1alpha1.Runs
and v1beta1.CustomRuns
, in theory, should be mutually exclusive. Therefore, I am not clear as to why we should add the conversion, when we should rather push the user to start using CustomRuns
while still providing support for Runs
(for a limited amount of time). In the end, the whole point of the K8 version control is to deprecate the less stable versions, i.e. v1alpha1
(where Runs
is stored), and keep upgrading to stable versions. If we are trying to upgrade Runs
to CustomRuns
from v1alpha
to v1beta1
, but still allow the users to be able to use the v1alpha1
feature, doesn't that negate the whole point of constantly trying to upgrade our K8 versioning? I understand @lbernick point that it would be harsh to the user to suddenly drop Runs
out of the blue and force everyone to update their code, but would a slow push of CustomRuns
paired with telling users that Runs
will no longer be supported help solve that issue?
Just providing some food for thought here, let me know what you think!
Thanks for the great conversation @lbernick @XinruZhang @abayer . I would like to ask a couple of questions regarding this situation. To my understanding,
v1alpha1.Runs
andv1beta1.CustomRuns
, in theory, should be mutually exclusive. Therefore, I am not clear as to why we should add the conversion, when we should rather push the user to start usingCustomRuns
while still providing support forRuns
(for a limited amount of time).
The main purpose of implementing conversion is so that we only have to support one golang version in our reconciler code, because each served version (version that users can use) gets converted into the same stored version (version stored in etcd and used by our reconciler code). If we aren't able to implement conversion, our reconciler code will have to support both v1alpha1 Run and v1beta1 CustomRun. Contrast this to PipelineRun: our stored version is v1beta1, but once we start serving v1, it will be converted into a v1beta1 PipelineRun for use in our reconciler, so the reconciler code only needs to handle one version at a time.
I agree we'd like to ask users to swap to customruns while still supporting runs for a short window.
In the end, the whole point of the K8 version control is to deprecate the less stable versions, i.e.
v1alpha1
(whereRuns
is stored), and keep upgrading to stable versions. If we are trying to upgradeRuns
toCustomRuns
fromv1alpha
tov1beta1
, but still allow the users to be able to use thev1alpha1
feature, doesn't that negate the whole point of constantly trying to upgrade our K8 versioning? I understand @lbernick point that it would be harsh to the user to suddenly dropRuns
out of the blue and force everyone to update their code, but would a slow push ofCustomRuns
paired with telling users thatRuns
will no longer be supported help solve that issue?
I agree we'd like to remove support for Runs (I'm not sure exactly what you mean by a "slow push" here). The question is just how best to create a release where we support both Runs and CustomRuns, before creating a release where we remove support for Runs.
/cc @dibyom
please review
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: jerop
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [jerop]
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
I'm not sure this PR should go in yet-- we're exposing a CRD that doesn't actually do anything when you create it
/hold
Here is a doc with the roadmap for this PR. The doc summarizes the lengthy conversation we have had in this PR and what the team has agreed upon for next steps for the PR.
Once again, thank you @lbernick @XinruZhang and @abayer for the great discussion!
The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage
to re-run this coverage report
File | Old Coverage | New Coverage | Delta |
---|---|---|---|
pkg/reconciler/pipelinerun/pipelinerun.go | 85.0% | 81.4% | -3.6 |
The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage
to re-run this coverage report
File | Old Coverage | New Coverage | Delta |
---|---|---|---|
pkg/reconciler/pipelinerun/pipelinerun.go | 85.0% | 81.4% | -3.6 |
/hold cancel
The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage
to re-run this coverage report
File | Old Coverage | New Coverage | Delta |
---|---|---|---|
pkg/reconciler/pipelinerun/pipelinerun.go | 85.0% | 80.5% | -4.6 |
The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage
to re-run this coverage report
File | Old Coverage | New Coverage | Delta |
---|---|---|---|
pkg/reconciler/pipelinerun/pipelinerun.go | 85.0% | 80.4% | -4.6 |
The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage
to re-run this coverage report
File | Old Coverage | New Coverage | Delta |
---|---|---|---|
pkg/reconciler/pipelinerun/pipelinerun.go | 85.0% | 80.4% | -4.6 |
The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage
to re-run this coverage report
File | Old Coverage | New Coverage | Delta |
---|---|---|---|
pkg/reconciler/pipelinerun/pipelinerun.go | 85.0% | 82.8% | -2.2 |
@vsinghai: The following tests failed, say /retest
to rerun all failed tests or /retest-required
to rerun all mandatory failed tests:
Test name | Commit | Details | Required | Rerun command |
---|---|---|---|---|
pull-tekton-pipeline-unit-tests | bd2d0c5f24cd7da4e6c3c31eb576b73babdd344d | link | true | /test tekton-pipeline-unit-tests |
pull-tekton-pipeline-alpha-integration-tests | bd2d0c5f24cd7da4e6c3c31eb576b73babdd344d | link | true | /test pull-tekton-pipeline-alpha-integration-tests |
pull-tekton-pipeline-integration-tests | bd2d0c5f24cd7da4e6c3c31eb576b73babdd344d | link | true | /test pull-tekton-pipeline-integration-tests |
pull-tekton-pipeline-build-tests | bd2d0c5f24cd7da4e6c3c31eb576b73babdd344d | link | true | /test pull-tekton-pipeline-build-tests |
Full PR test history. Your PR dashboard.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.
@vsinghai: PR needs rebase.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.