Skip to content

Lookup k8s services to ensure they exist#2149

Merged
knative-prow-robot merged 1 commit intoknative:mainfrom
benmoss:lookup-services
Jun 11, 2021
Merged

Lookup k8s services to ensure they exist#2149
knative-prow-robot merged 1 commit intoknative:mainfrom
benmoss:lookup-services

Conversation

@benmoss
Copy link
Contributor

@benmoss benmoss commented Jun 9, 2021

Changes

  • 🐛 Fix URIResolver to verify that k8s services exist before returning their URI

/kind bug

Fixes knative/eventing#5442

Release Note

URIResolver will now error if resolving a k8s service that does not exist

@knative-prow-robot knative-prow-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 9, 2021
@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Jun 9, 2021
@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 9, 2021
@benmoss benmoss force-pushed the lookup-services branch from 8203924 to f84e810 Compare June 9, 2021 14:23
@codecov
Copy link

codecov bot commented Jun 9, 2021

Codecov Report

Merging #2149 (f84e810) into main (c1db741) will increase coverage by 0.04%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2149      +/-   ##
==========================================
+ Coverage   67.56%   67.60%   +0.04%     
==========================================
  Files         215      215              
  Lines        9098     9098              
==========================================
+ Hits         6147     6151       +4     
+ Misses       2676     2674       -2     
+ Partials      275      273       -2     
Impacted Files Coverage Δ
resolver/addressable_resolver.go 95.34% <66.66%> (ø)
test/gcs/mock/mock.go 92.47% <0.00%> (+2.15%) ⬆️

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 c1db741...f84e810. Read the comment docs.

@benmoss
Copy link
Contributor Author

benmoss commented Jun 9, 2021

Looks like we might be depending on this behavior in eventing tests

@dprotaso
Copy link
Member

/assign @n3wscott @vaikas

Comment on lines +162 to +170
if err != nil {
return nil, apierrs.NewNotFound(gvr.GroupResource(), "Lister")
}

obj, err := lister.ByNamespace(ref.Namespace).Get(ref.Name)
if err != nil {
return nil, apierrs.NewNotFound(gvr.GroupResource(), ref.Name)
}

Copy link
Member

Choose a reason for hiding this comment

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

I know this code was here before but is there not a distinction between an error and object not found

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, always a bit odd to see a dropped err value

@vaikas
Copy link
Contributor

vaikas commented Jun 11, 2021

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 11, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: benmoss, vaikas

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 Jun 11, 2021
@knative-prow-robot knative-prow-robot merged commit dd15eb0 into knative:main Jun 11, 2021
cardil added a commit to cardil/knative-eventing that referenced this pull request Jun 14, 2021
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. kind/bug Categorizes issue or PR as related to a bug. 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.

Trigger can pass duck.WaitForResourceReady on GKE without subscriber being deployed yet

5 participants