Skip to content
This repository has been archived by the owner on Jun 4, 2021. It is now read-only.

Add PrometheusSource webhook #1225

Merged
merged 1 commit into from
Jun 3, 2020

Conversation

MIBc
Copy link
Contributor

@MIBc MIBc commented May 13, 2020

Fixes: #1111

Proposed Changes

  • Add validation and default webhook for prometheus source.

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label May 13, 2020
@knative-prow-robot knative-prow-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label May 13, 2020
@knative-prow-robot
Copy link
Contributor

Hi @MIBc. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 13, 2020
@lberk
Copy link
Member

lberk commented May 13, 2020

/ok-to-test

@knative-prow-robot knative-prow-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 13, 2020
@MIBc
Copy link
Contributor Author

MIBc commented May 14, 2020

/retest

@MIBc
Copy link
Contributor Author

MIBc commented May 14, 2020

/assign @matzew

@matzew
Copy link
Member

matzew commented May 14, 2020

/unassign @matzew
/assign @lberk

@knative-prow-robot knative-prow-robot assigned lberk and unassigned matzew May 14, 2020

func main() {
ctx := webhook.WithOptions(signals.NewContext(), webhook.Options{
ServiceName: "prometheus-source-webhook",
Copy link
Member

Choose a reason for hiding this comment

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

we use logconfig.WebhookName() below, could we please use it here too to stay consistent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,45 @@
# Copyright 2019 The Knative Authors
Copy link
Member

Choose a reason for hiding this comment

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

2019?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Fixes: knative#1111

* Add validation and default webhook for prometheus source.
@MIBc MIBc force-pushed the prometheus-webhook branch from 4af4b15 to 8954435 Compare May 16, 2020 11:24
@MIBc
Copy link
Contributor Author

MIBc commented May 16, 2020

/retest

@lberk
Copy link
Member

lberk commented May 18, 2020

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label May 18, 2020
@MIBc
Copy link
Contributor Author

MIBc commented May 23, 2020

/assign @matzew

@matzew
Copy link
Member

matzew commented Jun 3, 2020

/approve

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lberk, matzew, MIBc

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

@matzew
Copy link
Member

matzew commented Jun 3, 2020

/test all

@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 3, 2020
@matzew
Copy link
Member

matzew commented Jun 3, 2020

/hold

@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 3, 2020
@knative-metrics-robot
Copy link

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

File Old Coverage New Coverage Delta
prometheus/pkg/apis/sources/v1alpha1/prometheus_defaults.go Do not exist 100.0%
prometheus/pkg/apis/sources/v1alpha1/prometheus_validation.go Do not exist 75.0%

@matzew
Copy link
Member

matzew commented Jun 3, 2020

/unhold

@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 3, 2020
@knative-prow-robot knative-prow-robot merged commit 6bdf16e into knative:master Jun 3, 2020
@MIBc MIBc deleted the prometheus-webhook branch June 4, 2020 00:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PrometheusSource should implement apis.Validatable and apis.Defaultable
6 participants