Skip to content

add PingSource v1beta2#4474

Merged
knative-prow-robot merged 5 commits into
knative:masterfrom
eclipselu:pingsource-v1beta2
Nov 17, 2020
Merged

add PingSource v1beta2#4474
knative-prow-robot merged 5 commits into
knative:masterfrom
eclipselu:pingsource-v1beta2

Conversation

@eclipselu
Copy link
Copy Markdown
Contributor

@eclipselu eclipselu commented Nov 5, 2020

Fixes #4167, #4206

Proposed Changes

  • 🎁 added PingSource v1beta2, it adds support for binary data encoded in base64.

Release Note

added PingSource v1beta2, it adds support for binary data encoded in base64. 

Docs

@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 5, 2020
@google-cla google-cla Bot added the cla: yes Indicates the PR's author has signed the CLA. label Nov 5, 2020
@knative-prow-robot knative-prow-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. area/test-and-release Test infrastructure, tests or release labels Nov 5, 2020
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 5, 2020

Codecov Report

Merging #4474 (b43d52e) into master (fd20fbc) will increase coverage by 0.15%.
The diff coverage is 91.60%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
pkg/adapter/mtping/adapter.go 75.60% <ø> (ø)
pkg/adapter/mtping/controller.go 81.81% <ø> (ø)
pkg/adapter/mtping/pingsource.go 66.66% <ø> (ø)
pkg/reconciler/pingsource/controller.go 87.50% <ø> (ø)
pkg/apis/sources/v1beta2/ping_lifecycle.go 60.00% <60.00%> (ø)
pkg/apis/sources/v1beta1/ping_conversion.go 96.07% <96.07%> (-3.93%) ⬇️
pkg/adapter/mtping/runner.go 94.44% <100.00%> (+3.53%) ⬆️
pkg/apis/sources/v1beta2/ping_conversion.go 100.00% <100.00%> (ø)
pkg/apis/sources/v1beta2/ping_defaults.go 100.00% <100.00%> (ø)
pkg/apis/sources/v1beta2/ping_types.go 100.00% <100.00%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fd20fbc...b43d52e. Read the comment docs.

Comment thread config/core/resources/pingsource.yaml Outdated
Comment thread config/core/resources/pingsource.yaml Outdated
Comment thread config/core/resources/pingsource.yaml Outdated
Comment thread pkg/adapter/mtping/pingsource_test.go
Comment thread pkg/adapter/mtping/runner.go Outdated
Comment thread pkg/apis/sources/v1beta2/ping_validation.go
@eclipselu eclipselu changed the title [WIP] add PingSource v1beta2 add PingSource v1beta2 Nov 9, 2020
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 9, 2020
@eclipselu
Copy link
Copy Markdown
Contributor Author

/retest

@eclipselu eclipselu changed the title add PingSource v1beta2 [WIP] add PingSource v1beta2 Nov 10, 2020
@knative-prow-robot knative-prow-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 10, 2020
@matzew
Copy link
Copy Markdown
Member

matzew commented Nov 12, 2020

@eclipselu this thing needs a rebase

@eclipselu
Copy link
Copy Markdown
Contributor Author

@eclipselu this thing needs a rebase

Thanks for the reminder, this PR needs some more work. will do rebase

@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 12, 2020
@eclipselu
Copy link
Copy Markdown
Contributor Author

/retest

2 similar comments
@eclipselu
Copy link
Copy Markdown
Contributor Author

/retest

@eclipselu
Copy link
Copy Markdown
Contributor Author

/retest

@eclipselu
Copy link
Copy Markdown
Contributor Author

/test ?

@knative-prow-robot
Copy link
Copy Markdown
Contributor

@eclipselu: The following commands are available to trigger jobs:

  • /test pull-knative-eventing-build-tests
  • /test pull-knative-eventing-unit-tests
  • /test pull-knative-eventing-integration-tests
  • /test pull-knative-eventing-conformance-tests
  • /test pull-knative-eventing-upgrade-tests
  • /test pull-knative-eventing-go-coverage

Use /test all to run all jobs.

Details

In response to this:

/test ?

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.

@eclipselu eclipselu changed the title [WIP] add PingSource v1beta2 add PingSource v1beta2 Nov 13, 2020
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 13, 2020
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 13, 2020
@eclipselu
Copy link
Copy Markdown
Contributor Author

eclipselu commented Nov 13, 2020

@eclipselu We can add the post-install job in a follow-up PR.

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

@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on the affected files.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/adapter/mtping/runner.go 94.6% 97.8% 3.2
pkg/apis/sources/v1beta1/ping_conversion.go 100.0% 97.7% -2.3
pkg/apis/sources/v1beta2/ping_conversion.go Do not exist 100.0%
pkg/apis/sources/v1beta2/ping_defaults.go Do not exist 100.0%
pkg/apis/sources/v1beta2/ping_lifecycle.go Do not exist 68.0%
pkg/apis/sources/v1beta2/ping_types.go Do not exist 100.0%
pkg/apis/sources/v1beta2/ping_validation.go Do not exist 100.0%
pkg/apis/sources/v1beta2/register.go Do not exist 100.0%

Comment thread pkg/adapter/mtping/runner.go
Comment thread pkg/adapter/mtping/runner.go
Comment thread pkg/apis/sources/v1beta1/ping_conversion.go
Comment thread pkg/apis/sources/v1beta2/ping_types.go
Comment thread pkg/apis/sources/v1beta2/ping_validation.go
Comment thread pkg/apis/sources/v1beta1/ping_conversion.go
Comment thread pkg/apis/sources/v1beta1/ping_conversion.go
@nachocano
Copy link
Copy Markdown
Contributor

Thanks @eclipselu !!! Great work, I added a few nits in case you want to address them in this PR.

/approve
Leaving the lgtm to @lionelvillard

@knative-prow-robot
Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 16, 2020
}

// v1beta2 objects originally converted from v1beta1 is expected to have this annotation
v1beta1Spec, ok := annotations[V1B1SpecAnnotationKey]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, the conversion should fail when the annotation is not present. Otherwise the spec looks incomplete.

Copy link
Copy Markdown
Contributor Author

@eclipselu eclipselu Nov 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 exist

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lionelvillard
Copy link
Copy Markdown
Contributor

@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

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 17, 2020
@knative-prow-robot knative-prow-robot merged commit 3fca4a2 into knative:master Nov 17, 2020
@eclipselu
Copy link
Copy Markdown
Contributor Author

@nachocano this PR got auto-merged without the nits fix, please take a look here: #4537 thanks!

@lionelvillard
Copy link
Copy Markdown
Contributor

sorry about that, I should have put a hold.

@nachocano
Copy link
Copy Markdown
Contributor

nachocano commented Nov 17, 2020 via email

@eclipselu
Copy link
Copy Markdown
Contributor Author

sorry about that, I should have put a hold.

no worries, the PR was merged too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test-and-release Test infrastructure, tests or release cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move PingSource to v1beta2

8 participants