Skip to content

Commit e57525e

Browse files
authored
bump catalogd to v0.30.0 (#1329)
Signed-off-by: Joe Lanford <[email protected]>
1 parent 8466890 commit e57525e

File tree

15 files changed

+73
-67
lines changed

15 files changed

+73
-67
lines changed

config/samples/catalogd_operatorcatalog.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: operatorhubio
55
spec:
66
source:
7-
type: image
7+
type: Image
88
image:
99
ref: quay.io/operatorhubio/catalog:latest
1010
pollInterval: 10m

docs/api-reference/catalogd-api-reference.md

+11-12
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Package v1alpha1 contains API Schema definitions for the core v1alpha1 API group
2727

2828

2929
CatalogSource is a discriminated union of possible sources for a Catalog.
30+
CatalogSource contains the sourcing information for a Catalog
3031

3132

3233

@@ -35,8 +36,8 @@ _Appears in:_
3536

3637
| Field | Description | Default | Validation |
3738
| --- | --- | --- | --- |
38-
| `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 /> |
39-
| `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. | | |
39+
| `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 /> |
40+
| `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. | | |
4041

4142

4243
#### ClusterCatalog
@@ -95,7 +96,7 @@ _Appears in:_
9596

9697
| Field | Description | Default | Validation |
9798
| --- | --- | --- | --- |
98-
| `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 | | |
99+
| `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 | | |
99100
| `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 | |
100101

101102

@@ -113,10 +114,9 @@ _Appears in:_
113114
| Field | Description | Default | Validation |
114115
| --- | --- | --- | --- |
115116
| `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. | | |
116-
| `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 | | |
117+
| `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 | | |
117118
| `contentURL` _string_ | contentURL is a cluster-internal URL from which on-cluster components<br />can read the content of a catalog | | |
118-
| `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. | | |
119-
| `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. | | |
119+
| `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. | | |
120120

121121

122122
#### ImageSource
@@ -141,6 +141,7 @@ _Appears in:_
141141

142142

143143
ResolvedCatalogSource is a discriminated union of resolution information for a Catalog.
144+
ResolvedCatalogSource contains the information about a sourced Catalog
144145

145146

146147

@@ -149,7 +150,7 @@ _Appears in:_
149150

150151
| Field | Description | Default | Validation |
151152
| --- | --- | --- | --- |
152-
| `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 /> |
153+
| `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 /> |
153154
| `image` _[ResolvedImageSource](#resolvedimagesource)_ | image is a field containing resolution information for a catalog sourced from an image. | | |
154155

155156

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

167168
| Field | Description | Default | Validation |
168169
| --- | --- | --- | --- |
169-
| `ref` _string_ | ref is the reference to a container image containing Catalog contents. | | |
170-
| `resolvedRef` _string_ | resolvedRef is the resolved sha256 image ref containing Catalog contents. | | |
171-
| `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. | | |
172-
| `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. | | |
170+
| `ref` _string_ | ref contains the resolved sha256 image ref containing Catalog contents. | | |
171+
| `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. | | |
173172

174173

175174
#### SourceType
@@ -186,6 +185,6 @@ _Appears in:_
186185

187186
| Field | Description |
188187
| --- | --- |
189-
| `image` | |
188+
| `Image` | |
190189

191190

docs/concepts/controlling-catalog-selection.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ metadata:
132132
spec:
133133
priority: 1000
134134
source:
135-
type: image
135+
type: Image
136136
image:
137137
ref: quay.io/example/high-priority-content-management:latest
138138
```
@@ -169,7 +169,7 @@ If the system cannot resolve to a single bundle due to ambiguity, it will genera
169169
spec:
170170
priority: 1000
171171
source:
172-
type: image
172+
type: Image
173173
image:
174174
ref: quay.io/example/content-management-a:latest
175175
```
@@ -184,7 +184,7 @@ If the system cannot resolve to a single bundle due to ambiguity, it will genera
184184
spec:
185185
priority: 500
186186
source:
187-
type: image
187+
type: Image
188188
image:
189189
ref: quay.io/example/content-management-b:latest
190190
```

docs/getting-started/olmv1_getting_started.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@ metadata:
4141
name: operatorhubio
4242
spec:
4343
source:
44-
type: image
44+
type: Image
4545
image:
4646
ref: quay.io/operatorhubio/catalog:latest
4747
pollInterval: 10m
4848
EOF
4949
```
5050

51-
Once the catalog is unpacked successfully, its content will be available for installation.
51+
Once the catalog is being served, its content will be available for installation.
5252

5353
```bash
54-
# Wait for the ClusterCatalog to be unpacked
55-
kubectl wait --for=condition=Unpacked=True clustercatalog/operatorhubio --timeout=60s
54+
# Wait for the ClusterCatalog to be ready
55+
kubectl wait --for=condition=Serving=True clustercatalog/operatorhubio --timeout=60s
5656
```
5757

5858
### Install a Cluster Extension

docs/tutorials/add-catalog.md

+22-15
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This catalog is distributed as an image [quay.io/operatorhubio/catalog](https://
3232
name: operatorhubio
3333
spec:
3434
source:
35-
type: image
35+
type: Image
3636
image:
3737
ref: <catalog_image>
3838
pollInterval: <poll_interval_duration>
@@ -54,10 +54,10 @@ This catalog is distributed as an image [quay.io/operatorhubio/catalog](https://
5454
name: operatorhub
5555
spec:
5656
source:
57-
type: image
57+
type: Image
5858
image:
5959
ref: quay.io/operatorhubio/catalog:latest
60-
pollInterval: 1h
60+
pollInterval: 10m
6161
```
6262
6363
2. Apply the ClusterCatalog CR:
@@ -94,7 +94,7 @@ This catalog is distributed as an image [quay.io/operatorhubio/catalog](https://
9494
``` terminal title="Example output"
9595
Name: operatorhubio
9696
Namespace:
97-
Labels: <none>
97+
Labels: olm.operatorframework.io/metadata.name=operatorhubio
9898
Annotations: <none>
9999
API Version: olm.operatorframework.io/v1alpha1
100100
Kind: ClusterCatalog
@@ -106,25 +106,32 @@ This catalog is distributed as an image [quay.io/operatorhubio/catalog](https://
106106
Resource Version: 6469
107107
UID: 2e2778cb-dda6-4645-96b7-992e8dd37503
108108
Spec:
109+
Priority: 0
109110
Source:
110111
Image:
111-
Poll Interval: 15m0s
112+
Poll Interval: 10m0s
112113
Ref: quay.io/operatorhubio/catalog:latest
113-
Type: image
114+
Type: Image
114115
Status:
115116
Conditions:
116117
Last Transition Time: 2024-03-12T19:35:34Z
117-
Message:
118-
Reason: UnpackSuccessful
118+
Message: Successfully unpacked and stored content from resolved source
119+
Observed Generation: 2
120+
Reason: Succeeded
121+
Status: False
122+
Type: Progressing
123+
Last Transition Time: 2024-03-12T19:35:34Z
124+
Message: Serving desired content from resolved source
125+
Observed Generation: 2
126+
Reason: Available
119127
Status: True
120-
Type: Unpacked
128+
Type: Serving
121129
Content URL: https://catalogd-server.olmv1-system.svc/catalogs/operatorhubio/all.json
122-
Observed Generation: 2
130+
Last Unpacked: 2024-03-12T19:35:34Z
123131
Resolved Source:
124132
Image:
125-
Last Poll Attempt: 2024-03-12T19:35:26Z
126-
Ref: quay.io/operatorhubio/catalog:latest
127-
Resolved Ref: quay.io/operatorhubio/catalog@sha256:dee29aaed76fd1c72b654b9bc8bebc4b48b34fd8d41ece880524dc0c3c1c55ec
128-
Type: image
129-
Events: <none>
133+
Last Successful Poll Attempt: 2024-03-12T19:35:26Z
134+
Ref: quay.io/operatorhubio/catalog@sha256:dee29aaed76fd1c72b654b9bc8bebc4b48b34fd8d41ece880524dc0c3c1c55ec
135+
Type: Image
136+
Events: <none>
130137
```

docs/tutorials/install-extension.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ After you add a catalog to your cluster, you can install an extension by creatin
1010

1111
## Prerequisites
1212

13-
* A deployed and unpacked catalog
13+
* A catalog that is being served
1414
* The name, and optionally version, or channel, of the [supported extension](../project/olmv1_limitations.md) to be installed
1515
* An existing namespace in which to install the extension
1616

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ require (
1717
github.com/onsi/gomega v1.34.2
1818
github.com/opencontainers/go-digest v1.0.0
1919
github.com/operator-framework/api v0.27.0
20-
github.com/operator-framework/catalogd v0.29.0
20+
github.com/operator-framework/catalogd v0.30.0
2121
github.com/operator-framework/helm-operator-plugins v0.5.0
2222
github.com/operator-framework/operator-registry v1.47.0
2323
github.com/spf13/pflag v1.0.5
@@ -139,7 +139,7 @@ require (
139139
github.com/json-iterator/go v1.1.12 // indirect
140140
github.com/k14s/starlark-go v0.0.0-20200720175618-3a5c849cc368 // indirect
141141
github.com/k14s/ytt v0.36.0 // indirect
142-
github.com/klauspost/compress v1.17.9 // indirect
142+
github.com/klauspost/compress v1.17.10 // indirect
143143
github.com/klauspost/pgzip v1.2.6 // indirect
144144
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
145145
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,8 @@ github.com/k14s/ytt v0.36.0/go.mod h1:awQ3bHBk1qT2Xn3GJVdmaLss2khZOIBBKFd2TNXZNM
412412
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
413413
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
414414
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
415-
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
416-
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
415+
github.com/klauspost/compress v1.17.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0=
416+
github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
417417
github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU=
418418
github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
419419
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
@@ -535,8 +535,8 @@ github.com/openshift/crd-schema-checker v0.0.0-20240404194209-35a9033b1d11 h1:eT
535535
github.com/openshift/crd-schema-checker v0.0.0-20240404194209-35a9033b1d11/go.mod h1:EmVJt97N+pfWFsli/ipXTBZqSG5F5KGQhm3c3IsGq1o=
536536
github.com/operator-framework/api v0.27.0 h1:OrVaGKZJvbZo58HTv2guz7aURkhVKYhFqZ/6VpifiXI=
537537
github.com/operator-framework/api v0.27.0/go.mod h1:lg2Xx+S8NQWGYlEOvFwQvH46E5EK5IrAIL7HWfAhciM=
538-
github.com/operator-framework/catalogd v0.29.0 h1:GpeBGUWNGbVTH9l2S4RLi2wRvLAguG/4LYdxqfrwlak=
539-
github.com/operator-framework/catalogd v0.29.0/go.mod h1:cikCg3BwFMyMrRhMXN6cxpv03Cm/EMV3rHX5yi2w8vo=
538+
github.com/operator-framework/catalogd v0.30.0 h1:uW5fGZ5vJlUy9n26B13WZLjc3OMrvr2gM4FQDStUd2Y=
539+
github.com/operator-framework/catalogd v0.30.0/go.mod h1:mSyAemlhvngQPylBU1nY/57syccOv1u9biyovhlRe08=
540540
github.com/operator-framework/helm-operator-plugins v0.5.0 h1:qph2OoECcI9mpuUBtOsWOMgvpx52mPTTSvzVxICsT04=
541541
github.com/operator-framework/helm-operator-plugins v0.5.0/go.mod h1:yVncrZ/FJNqedMil+055fk6sw8aMKRrget/AqGM0ig0=
542542
github.com/operator-framework/operator-lib v0.15.0 h1:0QeRM4PMtThqINpcFGCEBnIV3Z8u7/8fYLEx6mUtdcM=

hack/tools/catalogs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ If you use another container runtime, set the `CONTAINER_RUNTIME` environment va
3333

3434
#### download-catalog
3535

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

3838
Example:
3939

hack/tools/catalogs/download-catalog

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ if [ -z "$CLUSTER_CATALOG" ]; then
4646
exit 1
4747
fi
4848

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

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

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

internal/catalogmetadata/cache/cache.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ func NewFilesystemCache(cachePath string) *filesystemCache {
2828
// making decisions on when to attempt to refresh
2929
// the cache.
3030
type cacheData struct {
31-
ResolvedRef string
32-
Error error
31+
Ref string
32+
Error error
3333
}
3434

3535
// FilesystemCache is a cache that
@@ -78,8 +78,8 @@ func (fsc *filesystemCache) Put(catalogName, resolvedRef string, source io.Reade
7878
cacheFS, errToCache = fsc.writeFS(catalogName, source)
7979
}
8080
fsc.cacheDataByCatalogName[catalogName] = cacheData{
81-
ResolvedRef: resolvedRef,
82-
Error: errToCache,
81+
Ref: resolvedRef,
82+
Error: errToCache,
8383
}
8484

8585
return cacheFS, errToCache
@@ -144,7 +144,7 @@ func (fsc *filesystemCache) Get(catalogName, resolvedRef string) (fs.FS, error)
144144
func (fsc *filesystemCache) get(catalogName, resolvedRef string) (fs.FS, error) {
145145
cacheDir := fsc.cacheDir(catalogName)
146146
if data, ok := fsc.cacheDataByCatalogName[catalogName]; ok {
147-
if resolvedRef == data.ResolvedRef {
147+
if resolvedRef == data.Ref {
148148
if data.Error != nil {
149149
return nil, data.Error
150150
}

0 commit comments

Comments
 (0)