|
| 1 | +# Catalogd web server |
| 2 | + |
| 3 | +[Catalogd](https://github.com/operator-framework/catalogd), the OLM v1 component for making catalog contents available on cluster, includes |
| 4 | +a web server that serves catalog contents to clients via an HTTP(S) endpoint. |
| 5 | + |
| 6 | +The endpoint to retrieve this information is provided in the `.status.contentURL` of a `ClusterCatalog` resource. |
| 7 | +As an example: |
| 8 | + |
| 9 | +```yaml |
| 10 | + contentURL: https://catalogd-service.olmv1-system.svc/catalogs/operatorhubio/all.json |
| 11 | +``` |
| 12 | +
|
| 13 | +!!! note |
| 14 | +
|
| 15 | + The value of the `.status.contentURL` field in a `ClusterCatalog` resource is an arbitrary string value and can change at any time. |
| 16 | + While there are no guarantees on the exact value of this field, it will always be a URL that resolves successfully for clients using |
| 17 | + it to make a request from within the cluster. |
| 18 | + |
| 19 | +## Interacting With the Server |
| 20 | + |
| 21 | +### Supported HTTP Methods |
| 22 | + |
| 23 | +The HTTP request methods supported by the catalogd web server are: |
| 24 | + |
| 25 | +- [GET](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET) |
| 26 | +- [HEAD](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD) |
| 27 | + |
| 28 | +### Response Format |
| 29 | + |
| 30 | +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. |
| 31 | + |
| 32 | +??? example "Example JSON-encoded FBC snippet" |
| 33 | + |
| 34 | + ```json |
| 35 | + { |
| 36 | + "schema": "olm.package", |
| 37 | + "name": "cockroachdb", |
| 38 | + "defaultChannel": "stable-v6.x", |
| 39 | + } |
| 40 | + { |
| 41 | + "schema": "olm.channel", |
| 42 | + "name": "stable-v6.x", |
| 43 | + "package": "cockroachdb", |
| 44 | + "entries": [ |
| 45 | + { |
| 46 | + "name": "cockroachdb.v6.0.0", |
| 47 | + "skipRange": "<6.0.0" |
| 48 | + } |
| 49 | + ] |
| 50 | + } |
| 51 | + { |
| 52 | + "schema": "olm.bundle", |
| 53 | + "name": "cockroachdb.v6.0.0", |
| 54 | + "package": "cockroachdb", |
| 55 | + "image": "quay.io/openshift-community-operators/cockroachdb@sha256:d3016b1507515fc7712f9c47fd9082baf9ccb070aaab58ed0ef6e5abdedde8ba", |
| 56 | + "properties": [ |
| 57 | + { |
| 58 | + "type": "olm.package", |
| 59 | + "value": { |
| 60 | + "packageName": "cockroachdb", |
| 61 | + "version": "6.0.0" |
| 62 | + } |
| 63 | + }, |
| 64 | + ], |
| 65 | + } |
| 66 | + ``` |
| 67 | + |
| 68 | + Corresponding JSON lines response: |
| 69 | + ```jsonlines |
| 70 | + {"schema":"olm.package","name":"cockroachdb","defaultChannel":"stable-v6.x"} |
| 71 | + {"schema":"olm.channel","name":"stable-v6.x","package":"cockroachdb","entries":[{"name":"cockroachdb.v6.0.0","skipRange":"<6.0.0"}]} |
| 72 | + {"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"}}]} |
| 73 | + ``` |
| 74 | + |
| 75 | +### Compression Support |
| 76 | + |
| 77 | +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. |
| 78 | + |
| 79 | +The web server will include a `Content-Encoding: gzip` header in compressed responses. |
| 80 | + |
| 81 | +!!! note |
| 82 | + |
| 83 | + Only catalogs whose uncompressed response body would result in a response size greater than 1400 bytes will be compressed. |
| 84 | + |
| 85 | +### Cache Header Support |
| 86 | + |
| 87 | +For clients interested in caching the information returned from the `catalogd` web server, the `Last-Modified` header is set |
| 88 | +on responses and the `If-Modified-Since` header is supported for requests. |
0 commit comments