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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

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
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from mloiseleur. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 14, 2024
@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.

shell: bash
- name: Run Vacuum
run: |
go run github.com/daveshanley/vacuum@latest lint -d api/webhook.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we pin this or use a specific pinned action?

@@ -60,9 +60,12 @@ licensecheck:
exit 1; \
fi

oas-lint:
go run github.com/daveshanley/vacuum@latest lint -d api/webhook.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Same for the pinning comment above.

@@ -162,7 +162,6 @@ func TestAdjustEndpoints(t *testing.T) {
}
j, _ := json.Marshal(endpoints)
w.Write(j)

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 a mistake?

---
openapi: "3.0.0"
info:
version: 0.14.0
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 the ExternalDNS version? Do we want to add a v in front so that we can more easily find and replace it on release?

@@ -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?

description: Endpoints to update DNS records.
servers:
- url: http://localhost:8888
description: Server url for a k8s deployment.
Copy link
Contributor

Choose a reason for hiding this comment

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

Extreme nitpick, but for me it's better to always spell it Kubernetes, it is way more accessible to newcomers.

Suggested change
description: Server url for a k8s deployment.
description: Server url for a Kubernetes deployment.

- example.com
'500':
description: |
Failed to provide the list of domains we serve.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is wrong, I think. We failed the negotiation at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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