-
Notifications
You must be signed in to change notification settings - Fork 67
📖 add public api docs #1331
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
Merged
everettraven
merged 4 commits into
operator-framework:main
from
everettraven:docs/public-api
Oct 4, 2024
Merged
📖 add public api docs #1331
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Catalogd web server | ||
|
||
[Catalogd](https://github.com/operator-framework/catalogd), the OLM v1 component for making catalog contents available on cluster, includes | ||
a web server that serves catalog contents to clients via an HTTP(S) endpoint. | ||
|
||
The endpoint to retrieve this information is provided in the `.status.contentURL` of a `ClusterCatalog` resource. | ||
As an example: | ||
|
||
```yaml | ||
contentURL: https://catalogd-service.olmv1-system.svc/catalogs/operatorhubio/all.json | ||
``` | ||
|
||
!!! note | ||
|
||
The value of the `.status.contentURL` field in a `ClusterCatalog` resource is an arbitrary string value and can change at any time. | ||
While there are no guarantees on the exact value of this field, it will always be a URL that resolves successfully for clients using | ||
it to make a request from within the cluster. | ||
|
||
## Interacting With the Server | ||
|
||
### Supported HTTP Methods | ||
|
||
The HTTP request methods supported by the catalogd web server are: | ||
|
||
- [GET](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET) | ||
- [HEAD](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD) | ||
|
||
### Response Format | ||
|
||
Responses are encoded as a [JSON Lines](https://jsonlines.org/) stream of [File-Based Catalog](https://olm.operatorframework.io/docs/reference/file-based-catalogs) (FBC) [Meta](https://olm.operatorframework.io/docs/reference/file-based-catalogs/#schema) objects delimited by newlines. | ||
|
||
??? example "Example JSON-encoded FBC snippet" | ||
|
||
```json | ||
{ | ||
"schema": "olm.package", | ||
"name": "cockroachdb", | ||
"defaultChannel": "stable-v6.x", | ||
} | ||
{ | ||
"schema": "olm.channel", | ||
"name": "stable-v6.x", | ||
"package": "cockroachdb", | ||
"entries": [ | ||
{ | ||
"name": "cockroachdb.v6.0.0", | ||
"skipRange": "<6.0.0" | ||
} | ||
] | ||
} | ||
{ | ||
"schema": "olm.bundle", | ||
"name": "cockroachdb.v6.0.0", | ||
"package": "cockroachdb", | ||
"image": "quay.io/openshift-community-operators/cockroachdb@sha256:d3016b1507515fc7712f9c47fd9082baf9ccb070aaab58ed0ef6e5abdedde8ba", | ||
"properties": [ | ||
{ | ||
"type": "olm.package", | ||
"value": { | ||
"packageName": "cockroachdb", | ||
"version": "6.0.0" | ||
} | ||
}, | ||
], | ||
} | ||
``` | ||
|
||
Corresponding JSON lines response: | ||
```jsonlines | ||
{"schema":"olm.package","name":"cockroachdb","defaultChannel":"stable-v6.x"} | ||
{"schema":"olm.channel","name":"stable-v6.x","package":"cockroachdb","entries":[{"name":"cockroachdb.v6.0.0","skipRange":"<6.0.0"}]} | ||
{"schema":"olm.bundle","name":"cockroachdb.v6.0.0","package":"cockroachdb","image":"quay.io/openshift-community-operators/cockroachdb@sha256:d3016b1507515fc7712f9c47fd9082baf9ccb070aaab58ed0ef6e5abdedde8ba","properties":[{"type":"olm.package","value":{"packageName":"cockroachdb","version":"6.0.0"}}]} | ||
``` | ||
|
||
### Compression Support | ||
|
||
The `catalogd` web server supports gzip compression of responses, which can significantly reduce associated network traffic. In order to signal that the client handles compressed responses, the client must include `Accept-Encoding: gzip` as a header in the HTTP request. | ||
|
||
The web server will include a `Content-Encoding: gzip` header in compressed responses. | ||
|
||
!!! note | ||
|
||
Only catalogs that result in a response size greater than 1400 bytes will be compressed. | ||
|
||
### Cache Header Support | ||
|
||
For clients interested in caching the information returned from the `catalogd` web server, the `Last-Modified` header is set | ||
on responses and the `If-Modified-Since` header is supported for requests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Public API | ||
The public API of OLM v1 is as follows: | ||
|
||
- Kubernetes APIs. For more information on these APIs, see: | ||
- [operator-controller API reference](./api/operator-controller-api-reference.md) | ||
- [catalogd API reference](./api/catalogd-api-reference.md) | ||
- `Catalogd` web server. For more information on what this includes, see the [catalogd web server documentation](./api/catalogd-webserver.md) | ||
|
||
!!! warning | ||
|
||
Only what is mentioned in the above documentation references is considered part of the public API | ||
and follows SemVer. Anything not mentioned in the above references is prone to breaking changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.