add PingSource v1beta2#4474
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4474 +/- ##
==========================================
+ Coverage 81.27% 81.42% +0.15%
==========================================
Files 284 290 +6
Lines 8017 8142 +125
==========================================
+ Hits 6516 6630 +114
- Misses 1113 1120 +7
- Partials 388 392 +4
Continue to review full report at Codecov.
|
|
/retest |
|
@eclipselu this thing needs a rebase |
Thanks for the reminder, this PR needs some more work. will do rebase |
|
/retest |
2 similar comments
|
/retest |
|
/retest |
|
/test ? |
|
@eclipselu: The following commands are available to trigger jobs:
Use DetailsIn response to this:
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. |
yeah, sure. and just to be clear, the post-install job will convert v1beta1 objects to v1beta2, and flip the storage version to v1beta2, we're introducing the post-install job in 0.21, not 0.20. only this pr will be released in 0.20 |
|
The following is the coverage report on the affected files.
|
|
Thanks @eclipselu !!! Great work, I added a few nits in case you want to address them in this PR. /approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: eclipselu, nachocano The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
| } | ||
|
|
||
| // v1beta2 objects originally converted from v1beta1 is expected to have this annotation | ||
| v1beta1Spec, ok := annotations[V1B1SpecAnnotationKey] |
There was a problem hiding this comment.
IMO, the conversion should fail when the annotation is not present. Otherwise the spec looks incomplete.
There was a problem hiding this comment.
the storage version is v1beta1, if we fail it here then when we create v1beta2 PingSource the annotation should also be specified, otherwise the creation will fail, for example:
$ kubectl create -n pingsource-example -f - <<EOF
apiVersion: sources.knative.dev/v1beta2
kind: PingSource
metadata:
name: test-ping-source-v1beta2-x3
spec:
schedule: "*/1 * * * *"
contentType: "text/plain"
data: "beta2 beta2 beta2"
sink:
ref:
apiVersion: v1
kind: Service
name: event-display
EOF
Error from server: error when creating "STDIN": conversion webhook for sources.knative.dev/v1beta2, Kind=PingSource failed: conversion failed to version v1beta1 for type [kind=PingSource group=sources.knative.dev version=v1beta2] - V1B1SpecAnnotationKey does not existThere was a problem hiding this comment.
Oops sorry I forgot the storage version is v1beta1. What feels strange is when getting the v1beta1 version of a v1beta2 instance, the spec is not what I would expect.
My example is this one:
apiVersion: sources.knative.dev/v1beta2
kind: PingSource
metadata:
name: hello-no-wrapper
spec:
schedule: "*/1 * * * *"
data: "hello"
sink:
ref:
apiVersion: v1
kind: Service
name: event-display$ kubectl get pingsources.v1beta1.sources.knative.dev hello-no-wrapper -oyaml
...
metadata:
annotations:
pingsources.sources.knative.dev/v1beta2-spec: '{"sink":{"ref":{"kind":"Service","name":"event-display","apiVersion":"v1"}},"schedule":"*/1
* * * *","data":"hello"}'
spec:
schedule: '* * * * *'
sink: {}
...
Not a biggie. I don't think getting a previous version is common.
There was a problem hiding this comment.
yes, this goes back to our original discussion on round-tripping, there's no deterministic way to know the expected v1beta1 spec by only looking at v1beta2 spec.
so here v1beta1 just serves as an envelope for v1beta2 spec.
|
@eclipselu can you create 2 issues, one to update the documentation and one for adding a post-install job upgrading the storage version to v1beta2? /lgtm |
|
@nachocano this PR got auto-merged without the nits fix, please take a look here: #4537 thanks! |
|
sorry about that, I should have put a hold. |
|
all good, glad this got in!
…On Tue, Nov 17, 2020 at 11:45 AM Lionel Villard ***@***.***> wrote:
sorry about that, I should have put a hold.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4474 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABD65DE2D2EA5T3YJWK75XLSQLHGJANCNFSM4TL3YKRQ>
.
|
no worries, the PR was merged too. |
Fixes #4167, #4206
Proposed Changes
Release Note
Docs