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

Validate Sink in SourceSpec #2384

Merged

Conversation

pierDipi
Copy link
Member

@pierDipi pierDipi commented Jan 4, 2022

  • The Sink in SourceSpec is required.
  • Validate the sink field using Destination.Validate(ctx)

The `Sink` in `SourceSpec` is required.

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 4, 2022
@codecov
Copy link

codecov bot commented Jan 4, 2022

Codecov Report

Merging #2384 (a525164) into main (fe5b178) will decrease coverage by 0.00%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2384      +/-   ##
==========================================
- Coverage   63.33%   63.33%   -0.01%     
==========================================
  Files         226      226              
  Lines        9779     9782       +3     
==========================================
+ Hits         6194     6195       +1     
- Misses       3306     3307       +1     
- Partials      279      280       +1     
Impacted Files Coverage Δ
apis/duck/v1/source_types.go 45.28% <66.66%> (-0.72%) ⬇️

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 7927179...a525164. Read the comment docs.

@pierDipi
Copy link
Member Author

pierDipi commented Jan 4, 2022

/cc @lionelvillard @matzew

Copy link
Contributor

@odacremolbap odacremolbap left a comment

Choose a reason for hiding this comment

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

looking good.

apis/duck/v1/source_types.go Outdated Show resolved Hide resolved
Co-authored-by: Pablo Mercado <pablo@triggermesh.com>
@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 4, 2022
@lionelvillard
Copy link
Member

/lgtm

@pierDipi
Copy link
Member Author

/assign @evankanderson @julz

Copy link
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

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

One nit.

This is also an API change; it seems reasonable because a Source object without a destination seems nonsensical to me.

}, {
name: "empty source ceOverrides extensions validation",
src: &Source{Spec: SourceSpec{
Sink: Destination{
URI: func() *apis.URL {
Copy link
Member

Choose a reason for hiding this comment

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

How about apis.HTTP("localhost")?

@evankanderson
Copy link
Member

/approve

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: evankanderson, odacremolbap, pierDipi

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 Jan 11, 2022
@knative-prow-robot knative-prow-robot merged commit bba4470 into knative:main Jan 11, 2022
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. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants