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

api: Add libraries to Pascalify API endpoints #24967

Merged
merged 1 commit into from Apr 20, 2023
Merged

Conversation

joestringer
Copy link
Member

@joestringer joestringer commented Apr 19, 2023

We have various APIs defined in the Swagger specification, each of which
has a range of API endpoints like "GET /endpoint", "DELETE /ipam/{ip}",
etc. In order to make these endpoints easier to refer to in a consistent
manner, introduce new api library functions that consume a go-openapi
spec and generate PascalCase flags for each API. Add some additional
useful functions that can be used for the purpose of restricting the
accessibility of certain APIs based on this PascalCase configuration.

As a demonstration example of the pascalized strings, see the following (incomplete) table of APIs:

Method Path Flag
GET /endpoint GetEndpoint
PATCH /endpoint/{id} PatchEndpointID

This will be used by #24661 in order to allow the user to configure which API endpoints are exposed by the cilium-agent API server. See also #24968 for an example of how to use these libraries to generate a description of API flags.

@joestringer joestringer added the release-note/misc This PR makes changes that have no direct user impact. label Apr 19, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot added dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. and removed dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Apr 19, 2023
@joestringer joestringer reopened this Apr 19, 2023
@joestringer
Copy link
Member Author

joestringer commented Apr 19, 2023

Travis hit issues connecting to ubuntu apt repos, closing+reopening to fix

@joestringer joestringer reopened this Apr 19, 2023
We have various APIs defined in the Swagger specification, each of which
has a range of API endpoints like "GET /endpoint", "DELETE /ipam/{ip}",
etc. In order to make these endpoints easier to refer to in a consistent
manner, introduce new api library functions that consume a go-openapi
spec and generate PascalCase flags for each API. Add some additional
useful functions that can be used for the purpose of restricting the
accessibility of certain APIs based on this PascalCase configuration.

Signed-off-by: Joe Stringer <joe@cilium.io>
@joestringer
Copy link
Member Author

joestringer commented Apr 19, 2023

/test

Job 'Cilium-PR-K8s-1.16-kernel-4.19' failed:

Click to show.

Test Name

K8sDatapathConfig MonitorAggregation Checks that monitor aggregation restricts notifications

Failure Output


Jenkins URL: https://jenkins.cilium.io/job/Cilium-PR-K8s-1.16-kernel-4.19/992/

If it is a flake and a GitHub issue doesn't already exist to track it, comment /mlh new-flake Cilium-PR-K8s-1.16-kernel-4.19 so I can create one.

@joestringer joestringer marked this pull request as ready for review April 19, 2023 18:21
@joestringer joestringer requested a review from a team as a code owner April 19, 2023 18:21
@joestringer
Copy link
Member Author

k8s-1.16-kernel-4.19 job hit known flake #24840.

@joestringer
Copy link
Member Author

/test-1.16-4.19

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Apr 20, 2023
@ldelossa ldelossa merged commit a459b33 into main Apr 20, 2023
57 checks passed
@ldelossa ldelossa deleted the pr/joe/api-flags-lib branch April 20, 2023 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants