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

Make prober more generic #4543

Merged
merged 1 commit into from
Jun 27, 2019

Conversation

JRBANCEL
Copy link
Contributor

@JRBANCEL JRBANCEL commented Jun 26, 2019

The prober needs to be made more generic in order to be reused for #3312.

Proposed Changes

  • Remove hard-coded assumption that a probe request contains the header 'K-Network-Probe' and the probe response will contain a matching body
  • Extend ProbeOption to Preparer and Verifier to allow modification of probe request and validation of the probe response

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jun 26, 2019
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 26, 2019
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@JRBANCEL: 0 warnings.

In response to this:

The prober needs to be made more generic in order to be reused for #3312.

Proposed Changes

  • Remove hard-coded assumption that a probe request contains the header 'K-Network-Probe' and the probe response will contain a matching body
  • Extend ProbeOption to allow both modifying the probe request and validate the probe response
  • Rename ProbeOption to option to match go naming convention: prober.Option seems cleaner than prober.ProbeOption

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.

@knative-prow-robot knative-prow-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 26, 2019
Copy link
Contributor

@vagababov vagababov left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve
/hold
in case you want to change the name, otherwise cancel.

// ProbeOption is a way for caller to modify the HTTP request before it goes out.
type ProbeOption func(r *http.Request) *http.Request
// Preparer is a way for the caller to modify the HTTP request before it goes out.
type Preparer func(r *http.Request) *http.Request
Copy link
Contributor

Choose a reason for hiding this comment

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

RequestOpt(ion) is probably more expressive, but up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Naming is hard. I don't have an opinion on this.
Can easily be changed later if it is not clear enough.

@knative-prow-robot knative-prow-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels Jun 26, 2019
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JRBANCEL, vagababov

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 Jun 26, 2019
@tcnghia
Copy link
Contributor

tcnghia commented Jun 26, 2019

/test pull-knative-serving-integration-tests

@JRBANCEL JRBANCEL force-pushed the more-generic-prober-do branch from ac095b9 to 81917f5 Compare June 27, 2019 16:39
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Jun 27, 2019
@knative-metrics-robot
Copy link

The following is the coverage report on pkg/.
Say /test pull-knative-serving-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/network/prober/prober.go 93.9% 97.7% 3.7

@JRBANCEL
Copy link
Contributor Author

I had to fix merge conflicts.
Please LGTM again :-)

Copy link
Contributor

@vagababov vagababov left a comment

Choose a reason for hiding this comment

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

/lgtm

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

tcnghia commented Jun 27, 2019

/hold cancel

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 27, 2019
@knative-prow-robot knative-prow-robot merged commit 91a2f5f into knative:master Jun 27, 2019
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/API API objects and controllers area/autoscale area/networking cla: yes Indicates the PR's author has signed the CLA. 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.

6 participants