Skip to content
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

Trigger conversion function (v1alpha1 <-> v1beta1) #2508

Merged
merged 3 commits into from
Feb 5, 2020

Conversation

vaikas
Copy link
Contributor

@vaikas vaikas commented Feb 5, 2020

Addresses #1869

Proposed Changes

  • Add conversion functions for Trigger (v1alpha1 <-> v1beta1)
  • Decouple (clean-up) broker v1beta1 / v1alpha1 dependency

Release Note


@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 Feb 5, 2020
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Feb 5, 2020
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 5, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vaikas

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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 Feb 5, 2020
// Converts obj from v1beta1.Trigger into v1alpha1.Trigger
func (sink *Trigger) ConvertDown(ctx context.Context, obj apis.Convertible) error {
switch source := obj.(type) {
case *v1beta1.Trigger:
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be v1alpha1.Trigger right?

Copy link
Contributor

Choose a reason for hiding this comment

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

wait what the...

Copy link
Contributor

Choose a reason for hiding this comment

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

ah ok the older version takes the conversion. I see.


// ConvertDown implements apis.Convertible
func (sink *Trigger) ConvertDown(ctx context.Context, source apis.Convertible) error {
return fmt.Errorf("v1 is the highest known version, got: %T", source)
Copy link
Contributor

Choose a reason for hiding this comment

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

v1 -> v1beta1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, fixed.

@n3wscott
Copy link
Contributor

n3wscott commented Feb 5, 2020

/lgtm

There is a nit on #2508 (comment) with the wrong version in the error message.

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 5, 2020
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Feb 5, 2020
@vaikas vaikas changed the title WIP: trigger conversion Trigger conversion function (v1alpha1 <-> v1beta1) Feb 5, 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 Feb 5, 2020
@n3wscott
Copy link
Contributor

n3wscott commented Feb 5, 2020

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 5, 2020
@knative-metrics-robot
Copy link

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/apis/eventing/v1alpha1/trigger_conversion.go Do not exist 100.0%
pkg/apis/eventing/v1beta1/broker_lifecycle.go Do not exist 100.0%
pkg/apis/eventing/v1beta1/test_helper.go 100.0% 62.5% -37.5
pkg/apis/eventing/v1beta1/trigger_conversion.go Do not exist 100.0%
pkg/apis/eventing/v1beta1/trigger_lifecycle.go 46.7% 48.9% 2.2

@knative-prow-robot
Copy link
Contributor

@vaikas: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-knative-eventing-go-coverage 7f43b7a link /test pull-knative-eventing-go-coverage

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.

@knative-prow-robot knative-prow-robot merged commit 05bba2b into knative:master Feb 5, 2020
@vaikas vaikas deleted the trigger-conversion branch February 5, 2020 23:56
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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants