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

feat(webhook): initial OpenAPI spec #4874

Merged
merged 10 commits into from
Dec 1, 2024

Conversation

mloiseleur
Copy link
Contributor

Description

This PR is based on #4148.

Checklist

  • Unit tests updated
  • End user documentation updated

lyda and others added 7 commits November 3, 2024 17:37
This needs far better descriptions, but provides the initial
OpenAPI doc describing the webhook API as described in the code.
The vacuum run is now clean.
Explain some of the schemas and endpoints in more detail.
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 14, 2024
@k8s-ci-robot k8s-ci-robot requested a review from szuecs November 14, 2024 08:02
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 14, 2024
@mloiseleur
Copy link
Contributor Author

/assign @Raffo

@Raffo I am not sure which fields are mandatory (required)

Copy link
Contributor

@Raffo Raffo left a comment

Choose a reason for hiding this comment

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

Added a few comments. I wonder what we can do to keep this up to date given that is not generated from code.

.github/workflows/lint.yaml Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
provider/webhook/webhook_test.go Outdated Show resolved Hide resolved
api/webhook.yaml Outdated Show resolved Hide resolved
@@ -0,0 +1,265 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this generated or written from scratch? I don't see us changing the webhook interface a lot, but how do we remember to keep it up to date in that case? Is it a manual operation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FTM, it's generated by hand.
Some generators exists, with limitations.

In theory, the spec should be written and modified first, and the spec should be used in tests, too.
Some projects do the reverse, and generate spec from the source code.

I suggest to do it one step after the other.
If this way becomes a burden, we can always switch to the generated way.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm always for spec first, but there are not really compelling projects to do OpenAPI first in go that I am aware of. Anyway, for now I think we're good and this is a good new addition.

api/webhook.yaml Outdated Show resolved Hide resolved
api/webhook.yaml Outdated Show resolved Hide resolved
@Raffo
Copy link
Contributor

Raffo commented Nov 30, 2024

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 30, 2024
@Raffo
Copy link
Contributor

Raffo commented Nov 30, 2024

@mloiseleur I'll leave to you the self approve 😄

@mloiseleur
Copy link
Contributor Author

/approve
🙈

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mloiseleur

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 1, 2024
@k8s-ci-robot k8s-ci-robot merged commit eea985f into kubernetes-sigs:master Dec 1, 2024
13 checks passed
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", 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.

4 participants