Skip to content

Commit

Permalink
bump catalogd to v0.30.0
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Lanford <[email protected]>
  • Loading branch information
joelanford committed Oct 3, 2024
1 parent 801388a commit 4679c37
Show file tree
Hide file tree
Showing 16 changed files with 76 additions and 70 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@ metadata:
name: operatorhubio
spec:
source:
type: image
type: Image
image:
ref: quay.io/operatorhubio/catalog:latest
pollInterval: 10m
EOF
```

Once the catalog is unpacked successfully, its content will be available for installation.
Once the catalog is serving successfully, its content will be available for installation.

```bash
# Wait for the ClusterCatalog to be unpacked
kubectl wait --for=condition=Unpacked=True clustercatalog/operatorhubio --timeout=60s
# Wait for the ClusterCatalog to be served
kubectl wait --for=condition=Serving=True clustercatalog/operatorhubio --timeout=60s
```

### Install a Cluster Extension
Expand Down
2 changes: 1 addition & 1 deletion config/samples/catalogd_operatorcatalog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: operatorhubio
spec:
source:
type: image
type: Image
image:
ref: quay.io/operatorhubio/catalog:latest
pollInterval: 10m
37 changes: 22 additions & 15 deletions docs/Tasks/adding-a-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This catalog is distributed as an image [quay.io/operatorhubio/catalog](https://
name: operatorhubio
spec:
source:
type: image
type: Image
image:
ref: <catalog_image>
pollInterval: <poll_interval_duration>
Expand All @@ -49,10 +49,10 @@ This catalog is distributed as an image [quay.io/operatorhubio/catalog](https://
name: operatorhub
spec:
source:
type: image
type: Image
image:
ref: quay.io/operatorhubio/catalog:latest
pollInterval: 1h
pollInterval: 10m
```
2. Apply the ClusterCatalog CR:
Expand Down Expand Up @@ -89,7 +89,7 @@ This catalog is distributed as an image [quay.io/operatorhubio/catalog](https://
``` terminal title="Example output"
Name: operatorhubio
Namespace:
Labels: <none>
Labels: olm.operatorframework.io/metadata.name=operatorhubio
Annotations: <none>
API Version: olm.operatorframework.io/v1alpha1
Kind: ClusterCatalog
Expand All @@ -101,25 +101,32 @@ This catalog is distributed as an image [quay.io/operatorhubio/catalog](https://
Resource Version: 6469
UID: 2e2778cb-dda6-4645-96b7-992e8dd37503
Spec:
Priority: 0
Source:
Image:
Poll Interval: 15m0s
Poll Interval: 10m0s
Ref: quay.io/operatorhubio/catalog:latest
Type: image
Type: Image
Status:
Conditions:
Last Transition Time: 2024-03-12T19:35:34Z
Message:
Reason: UnpackSuccessful
Message: Successfully unpacked and stored content from resolved source
Observed Generation: 2
Reason: Succeeded
Status: False
Type: Progressing
Last Transition Time: 2024-03-12T19:35:34Z
Message: Serving desired content from resolved source
Observed Generation: 2
Reason: Available
Status: True
Type: Unpacked
Type: Serving
Content URL: https://catalogd-server.olmv1-system.svc/catalogs/operatorhubio/all.json
Observed Generation: 2
Last Unpacked: 2024-03-12T19:35:34Z
Resolved Source:
Image:
Last Poll Attempt: 2024-03-12T19:35:26Z
Ref: quay.io/operatorhubio/catalog:latest
Resolved Ref: quay.io/operatorhubio/catalog@sha256:dee29aaed76fd1c72b654b9bc8bebc4b48b34fd8d41ece880524dc0c3c1c55ec
Type: image
Events: <none>
Last Successful Poll Attempt: 2024-03-12T19:35:26Z
Ref: quay.io/operatorhubio/catalog@sha256:dee29aaed76fd1c72b654b9bc8bebc4b48b34fd8d41ece880524dc0c3c1c55ec
Type: Image
Events: <none>
```
2 changes: 1 addition & 1 deletion docs/Tasks/installing-an-extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ After you add a catalog to your cluster, you can install an extension by creatin

## Prerequisites

* A deployed and unpacked catalog
* A catalog that is being served
* The name, and optionally version, or channel, of the [supported extension](../concepts/supported-extensions.md) to be installed
* An existing namespace in which to install the extension
* A suitable service account for installation (more information can be found [here](../drafts/Tasks/create-installer-service-account.md))
Expand Down
6 changes: 3 additions & 3 deletions docs/drafts/controlling-catalog-selection.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ metadata:
spec:
priority: 1000
source:
type: image
type: Image
image:
ref: quay.io/example/high-priority-catalog:latest
```
Expand Down Expand Up @@ -169,7 +169,7 @@ If the system cannot resolve to a single bundle due to ambiguity, it will genera
spec:
priority: 1000
source:
type: image
type: Image
image:
ref: quay.io/example/catalog-a:latest
```
Expand All @@ -184,7 +184,7 @@ If the system cannot resolve to a single bundle due to ambiguity, it will genera
spec:
priority: 500
source:
type: image
type: Image
image:
ref: quay.io/example/catalog-b:latest
```
Expand Down
23 changes: 11 additions & 12 deletions docs/refs/api/catalogd-api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Package v1alpha1 contains API Schema definitions for the core v1alpha1 API group


CatalogSource is a discriminated union of possible sources for a Catalog.
CatalogSource contains the sourcing information for a Catalog



Expand All @@ -35,8 +36,8 @@ _Appears in:_

| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `type` _[SourceType](#sourcetype)_ | type is a required reference to the type of source the catalog is sourced from.<br /><br />Allowed values are ["image"]<br /><br />When this field is set to "image", the ClusterCatalog content will be sourced from an OCI image.<br />When using an image source, the image field must be set and must be the only field defined for this type. | | Enum: [image] <br />Required: \{\} <br /> |
| `image` _[ImageSource](#imagesource)_ | image is used to configure how catalog contents are sourced from an OCI image. This field must be set when type is set to "image" and must be the only field defined for this type. | | |
| `type` _[SourceType](#sourcetype)_ | type is a required reference to the type of source the catalog is sourced from.<br /><br />Allowed values are ["Image"]<br /><br />When this field is set to "Image", the ClusterCatalog content will be sourced from an OCI image.<br />When using an image source, the image field must be set and must be the only field defined for this type. | | Enum: [Image] <br />Required: \{\} <br /> |
| `image` _[ImageSource](#imagesource)_ | image is used to configure how catalog contents are sourced from an OCI image. This field must be set when type is set to "Image" and must be the only field defined for this type. | | |


#### ClusterCatalog
Expand Down Expand Up @@ -95,7 +96,7 @@ _Appears in:_

| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `source` _[CatalogSource](#catalogsource)_ | source is a required field that allows the user to define the source of a Catalog that contains catalog metadata in the File-Based Catalog (FBC) format.<br /><br />Below is a minimal example of a ClusterCatalogSpec that sources a catalog from an image:<br /><br /> source:<br /> type: image<br /> image:<br /> ref: quay.io/operatorhubio/catalog:latest<br /><br />For more information on FBC, see https://olm.operatorframework.io/docs/reference/file-based-catalogs/#docs | | |
| `source` _[CatalogSource](#catalogsource)_ | source is a required field that allows the user to define the source of a Catalog that contains catalog metadata in the File-Based Catalog (FBC) format.<br /><br />Below is a minimal example of a ClusterCatalogSpec that sources a catalog from an image:<br /><br /> source:<br /> type: Image<br /> image:<br /> ref: quay.io/operatorhubio/catalog:latest<br /><br />For more information on FBC, see https://olm.operatorframework.io/docs/reference/file-based-catalogs/#docs | | |
| `priority` _integer_ | priority is an optional field that allows the user to define a priority for a ClusterCatalog.<br />A ClusterCatalog's priority is used by clients as a tie-breaker between ClusterCatalogs that meet the client's requirements.<br />For example, in the case where multiple ClusterCatalogs provide the same bundle.<br />A higher number means higher priority. Negative number as also accepted.<br />When omitted, the default priority is 0. | 0 | |


Expand All @@ -113,10 +114,9 @@ _Appears in:_
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#condition-v1-meta) array_ | conditions is a representation of the current state for this ClusterCatalog.<br />The status is represented by a set of "conditions".<br /><br />Each condition is generally structured in the following format:<br /> - Type: a string representation of the condition type. More or less the condition "name".<br /> - Status: a string representation of the state of the condition. Can be one of ["True", "False", "Unknown"].<br /> - Reason: a string representation of the reason for the current state of the condition. Typically useful for building automation around particular Type+Reason combinations.<br /> - Message: a human-readable message that further elaborates on the state of the condition.<br /><br />The current set of condition types are:<br /> - "Unpacked", epresents whether, or not, the catalog contents have been successfully unpacked.<br /> - "Deleted", represents whether, or not, the catalog contents have been successfully deleted.<br /><br />The current set of reasons are:<br /> - "UnpackPending", this reason is set on the "Unpack" condition when unpacking the catalog has not started.<br /> - "Unpacking", this reason is set on the "Unpack" condition when the catalog is being unpacked.<br /> - "UnpackSuccessful", this reason is set on the "Unpack" condition when unpacking the catalog is successful and the catalog metadata is available to the cluster.<br /> - "FailedToStore", this reason is set on the "Unpack" condition when an error has been encountered while storing the contents of the catalog.<br /> - "FailedToDelete", this reason is set on the "Delete" condition when an error has been encountered while deleting the contents of the catalog. | | |
| `resolvedSource` _[ResolvedCatalogSource](#resolvedcatalogsource)_ | resolvedSource contains information about the resolved source based on the source type.<br /><br />Below is an example of a resolved source for an image source:<br />resolvedSource:<br /><br /> image:<br /> lastPollAttempt: "2024-09-10T12:22:13Z"<br /> lastUnpacked: "2024-09-10T12:22:13Z"<br /> ref: quay.io/operatorhubio/catalog:latest<br /> resolvedRef: quay.io/operatorhubio/catalog@sha256:c7392b4be033da629f9d665fec30f6901de51ce3adebeff0af579f311ee5cf1b<br /> type: image | | |
| `resolvedSource` _[ResolvedCatalogSource](#resolvedcatalogsource)_ | resolvedSource contains information about the resolved source based on the source type.<br /><br />Below is an example of a resolved source for an image source:<br />resolvedSource:<br /><br /> image:<br /> lastPollAttempt: "2024-09-10T12:22:13Z"<br /> lastUnpacked: "2024-09-10T12:22:13Z"<br /> ref: quay.io/operatorhubio/catalog:latest<br /> resolvedRef: quay.io/operatorhubio/catalog@sha256:c7392b4be033da629f9d665fec30f6901de51ce3adebeff0af579f311ee5cf1b<br /> type: Image | | |
| `contentURL` _string_ | contentURL is a cluster-internal URL from which on-cluster components<br />can read the content of a catalog | | |
| `observedGeneration` _integer_ | observedGeneration is the most recent generation observed for this ClusterCatalog. It corresponds to the<br />ClusterCatalog's generation, which is updated on mutation by the API Server. | | |
| `lastUnpacked` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#time-v1-meta)_ | lastUnpacked represents the time when the<br />ClusterCatalog object was last unpacked. | | |
| `lastUnpacked` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#time-v1-meta)_ | lastUnpacked represents the time when the<br />ClusterCatalog object was last unpacked successfully. | | |


#### ImageSource
Expand All @@ -141,6 +141,7 @@ _Appears in:_


ResolvedCatalogSource is a discriminated union of resolution information for a Catalog.
ResolvedCatalogSource contains the information about a sourced Catalog



Expand All @@ -149,7 +150,7 @@ _Appears in:_

| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `type` _[SourceType](#sourcetype)_ | type is a reference to the type of source the catalog is sourced from.<br /><br />It will be set to one of the following values: ["image"].<br /><br />When this field is set to "image", information about the resolved image source will be set in the 'image' field. | | Enum: [image] <br />Required: \{\} <br /> |
| `type` _[SourceType](#sourcetype)_ | type is a reference to the type of source the catalog is sourced from.<br /><br />It will be set to one of the following values: ["Image"].<br /><br />When this field is set to "Image", information about the resolved image source will be set in the 'image' field. | | Enum: [Image] <br />Required: \{\} <br /> |
| `image` _[ResolvedImageSource](#resolvedimagesource)_ | image is a field containing resolution information for a catalog sourced from an image. | | |


Expand All @@ -166,10 +167,8 @@ _Appears in:_

| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `ref` _string_ | ref is the reference to a container image containing Catalog contents. | | |
| `resolvedRef` _string_ | resolvedRef is the resolved sha256 image ref containing Catalog contents. | | |
| `lastPollAttempt` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#time-v1-meta)_ | lastPollAttempt is the time when the source image was last polled for new content. | | |
| `lastUnpacked` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#time-v1-meta)_ | lastUnpacked is the last time when the Catalog contents were successfully unpacked. | | |
| `ref` _string_ | ref contains the resolved sha256 image ref containing Catalog contents. | | |
| `lastSuccessfulPollAttempt` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#time-v1-meta)_ | lastSuccessfulPollAttempt is the time when the resolved source was last successfully polled for new content. | | |


#### SourceType
Expand All @@ -186,6 +185,6 @@ _Appears in:_

| Field | Description |
| --- | --- |
| `image` | |
| `Image` | |


4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/onsi/gomega v1.34.2
github.com/opencontainers/go-digest v1.0.0
github.com/operator-framework/api v0.27.0
github.com/operator-framework/catalogd v0.29.0
github.com/operator-framework/catalogd v0.30.0
github.com/operator-framework/helm-operator-plugins v0.5.0
github.com/operator-framework/operator-registry v1.47.0
github.com/spf13/pflag v1.0.5
Expand Down Expand Up @@ -139,7 +139,7 @@ require (
github.com/json-iterator/go v1.1.12 // indirect
github.com/k14s/starlark-go v0.0.0-20200720175618-3a5c849cc368 // indirect
github.com/k14s/ytt v0.36.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/compress v1.17.10 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ github.com/k14s/ytt v0.36.0/go.mod h1:awQ3bHBk1qT2Xn3GJVdmaLss2khZOIBBKFd2TNXZNM
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/klauspost/compress v1.17.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0=
github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU=
github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
Expand Down Expand Up @@ -535,8 +535,8 @@ github.com/openshift/crd-schema-checker v0.0.0-20240404194209-35a9033b1d11 h1:eT
github.com/openshift/crd-schema-checker v0.0.0-20240404194209-35a9033b1d11/go.mod h1:EmVJt97N+pfWFsli/ipXTBZqSG5F5KGQhm3c3IsGq1o=
github.com/operator-framework/api v0.27.0 h1:OrVaGKZJvbZo58HTv2guz7aURkhVKYhFqZ/6VpifiXI=
github.com/operator-framework/api v0.27.0/go.mod h1:lg2Xx+S8NQWGYlEOvFwQvH46E5EK5IrAIL7HWfAhciM=
github.com/operator-framework/catalogd v0.29.0 h1:GpeBGUWNGbVTH9l2S4RLi2wRvLAguG/4LYdxqfrwlak=
github.com/operator-framework/catalogd v0.29.0/go.mod h1:cikCg3BwFMyMrRhMXN6cxpv03Cm/EMV3rHX5yi2w8vo=
github.com/operator-framework/catalogd v0.30.0 h1:uW5fGZ5vJlUy9n26B13WZLjc3OMrvr2gM4FQDStUd2Y=
github.com/operator-framework/catalogd v0.30.0/go.mod h1:mSyAemlhvngQPylBU1nY/57syccOv1u9biyovhlRe08=
github.com/operator-framework/helm-operator-plugins v0.5.0 h1:qph2OoECcI9mpuUBtOsWOMgvpx52mPTTSvzVxICsT04=
github.com/operator-framework/helm-operator-plugins v0.5.0/go.mod h1:yVncrZ/FJNqedMil+055fk6sw8aMKRrget/AqGM0ig0=
github.com/operator-framework/operator-lib v0.15.0 h1:0QeRM4PMtThqINpcFGCEBnIV3Z8u7/8fYLEx6mUtdcM=
Expand Down
2 changes: 1 addition & 1 deletion hack/tools/catalogs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ If you use another container runtime, set the `CONTAINER_RUNTIME` environment va

#### download-catalog

Download a catalog from an unpacked ClusterCatalog running on a cluster reachable by `kubectl`.
Download a catalog from a served ClusterCatalog running on a cluster reachable by `kubectl`.

Example:

Expand Down
8 changes: 4 additions & 4 deletions hack/tools/catalogs/download-catalog
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ if [ -z "$CLUSTER_CATALOG" ]; then
exit 1
fi

# Check if the Unpacked condition is true
UNPACKED_CONDITION=$(echo "$CLUSTER_CATALOG" | jq -r '.status.conditions[]? // [] | select(.type=="Unpacked") | .status')
# Check if the Serving condition is true
UNPACKED_CONDITION=$(echo "$CLUSTER_CATALOG" | jq -r '.status.conditions[]? // [] | select(.type=="Serving") | .status')
if [ "$UNPACKED_CONDITION" != "True" ]; then
echo "ClusterCatalog $CATALOG_NAME is not unpacked yet."
echo "ClusterCatalog $CATALOG_NAME is not ready yet."
exit 1
fi

Expand Down Expand Up @@ -92,4 +92,4 @@ wget --no-check-certificate "$LOCAL_CONTENT_URL" -O "${CATALOG_NAME}-catalog.jso
echo "Stopping kubectl port-forward..."
kill $PORT_FORWARD_PID

echo "Catalog downloaded to ${CATALOG_NAME}-catalog.json"
echo "Catalog downloaded to ${CATALOG_NAME}-catalog.json"
Loading

0 comments on commit 4679c37

Please sign in to comment.