diff --git a/config/samples/catalogd_operatorcatalog.yaml b/config/samples/catalogd_operatorcatalog.yaml index 5965edeb1..48f1da573 100644 --- a/config/samples/catalogd_operatorcatalog.yaml +++ b/config/samples/catalogd_operatorcatalog.yaml @@ -4,7 +4,7 @@ metadata: name: operatorhubio spec: source: - type: image + type: Image image: ref: quay.io/operatorhubio/catalog:latest pollInterval: 10m diff --git a/docs/api-reference/catalogd-api-reference.md b/docs/api-reference/catalogd-api-reference.md index 07be6f3c6..80a4b327d 100644 --- a/docs/api-reference/catalogd-api-reference.md +++ b/docs/api-reference/catalogd-api-reference.md @@ -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 @@ -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.

Allowed values are ["image"]

When this field is set to "image", the ClusterCatalog content will be sourced from an OCI image.
When using an image source, the image field must be set and must be the only field defined for this type. | | Enum: [image]
Required: \{\}
| -| `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.

Allowed values are ["Image"]

When this field is set to "Image", the ClusterCatalog content will be sourced from an OCI image.
When using an image source, the image field must be set and must be the only field defined for this type. | | Enum: [Image]
Required: \{\}
| +| `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 @@ -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.

Below is a minimal example of a ClusterCatalogSpec that sources a catalog from an image:

source:
type: image
image:
ref: quay.io/operatorhubio/catalog:latest

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.

Below is a minimal example of a ClusterCatalogSpec that sources a catalog from an image:

source:
type: Image
image:
ref: quay.io/operatorhubio/catalog:latest

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.
A ClusterCatalog's priority is used by clients as a tie-breaker between ClusterCatalogs that meet the client's requirements.
For example, in the case where multiple ClusterCatalogs provide the same bundle.
A higher number means higher priority. Negative number as also accepted.
When omitted, the default priority is 0. | 0 | | @@ -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.
The status is represented by a set of "conditions".

Each condition is generally structured in the following format:
- Type: a string representation of the condition type. More or less the condition "name".
- Status: a string representation of the state of the condition. Can be one of ["True", "False", "Unknown"].
- Reason: a string representation of the reason for the current state of the condition. Typically useful for building automation around particular Type+Reason combinations.
- Message: a human-readable message that further elaborates on the state of the condition.

The current set of condition types are:
- "Unpacked", epresents whether, or not, the catalog contents have been successfully unpacked.
- "Deleted", represents whether, or not, the catalog contents have been successfully deleted.

The current set of reasons are:
- "UnpackPending", this reason is set on the "Unpack" condition when unpacking the catalog has not started.
- "Unpacking", this reason is set on the "Unpack" condition when the catalog is being unpacked.
- "UnpackSuccessful", this reason is set on the "Unpack" condition when unpacking the catalog is successful and the catalog metadata is available to the cluster.
- "FailedToStore", this reason is set on the "Unpack" condition when an error has been encountered while storing the contents of the catalog.
- "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.

Below is an example of a resolved source for an image source:
resolvedSource:

image:
lastPollAttempt: "2024-09-10T12:22:13Z"
lastUnpacked: "2024-09-10T12:22:13Z"
ref: quay.io/operatorhubio/catalog:latest
resolvedRef: quay.io/operatorhubio/catalog@sha256:c7392b4be033da629f9d665fec30f6901de51ce3adebeff0af579f311ee5cf1b
type: image | | | +| `resolvedSource` _[ResolvedCatalogSource](#resolvedcatalogsource)_ | resolvedSource contains information about the resolved source based on the source type.

Below is an example of a resolved source for an image source:
resolvedSource:

image:
lastPollAttempt: "2024-09-10T12:22:13Z"
lastUnpacked: "2024-09-10T12:22:13Z"
ref: quay.io/operatorhubio/catalog:latest
resolvedRef: quay.io/operatorhubio/catalog@sha256:c7392b4be033da629f9d665fec30f6901de51ce3adebeff0af579f311ee5cf1b
type: Image | | | | `contentURL` _string_ | contentURL is a cluster-internal URL from which on-cluster components
can read the content of a catalog | | | -| `observedGeneration` _integer_ | observedGeneration is the most recent generation observed for this ClusterCatalog. It corresponds to the
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
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
ClusterCatalog object was last unpacked successfully. | | | #### ImageSource @@ -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 @@ -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.

It will be set to one of the following values: ["image"].

When this field is set to "image", information about the resolved image source will be set in the 'image' field. | | Enum: [image]
Required: \{\}
| +| `type` _[SourceType](#sourcetype)_ | type is a reference to the type of source the catalog is sourced from.

It will be set to one of the following values: ["Image"].

When this field is set to "Image", information about the resolved image source will be set in the 'image' field. | | Enum: [Image]
Required: \{\}
| | `image` _[ResolvedImageSource](#resolvedimagesource)_ | image is a field containing resolution information for a catalog sourced from an image. | | | @@ -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 @@ -186,6 +185,6 @@ _Appears in:_ | Field | Description | | --- | --- | -| `image` | | +| `Image` | | diff --git a/docs/concepts/controlling-catalog-selection.md b/docs/concepts/controlling-catalog-selection.md index 544f36be5..68d19c2b3 100644 --- a/docs/concepts/controlling-catalog-selection.md +++ b/docs/concepts/controlling-catalog-selection.md @@ -132,7 +132,7 @@ metadata: spec: priority: 1000 source: - type: image + type: Image image: ref: quay.io/example/high-priority-content-management:latest ``` @@ -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/content-management-a:latest ``` @@ -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/content-management-b:latest ``` diff --git a/docs/getting-started/olmv1_getting_started.md b/docs/getting-started/olmv1_getting_started.md index 77760f4fc..1156bc968 100644 --- a/docs/getting-started/olmv1_getting_started.md +++ b/docs/getting-started/olmv1_getting_started.md @@ -41,18 +41,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 being served, 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 ready +kubectl wait --for=condition=Serving=True clustercatalog/operatorhubio --timeout=60s ``` ### Install a Cluster Extension diff --git a/docs/tutorials/add-catalog.md b/docs/tutorials/add-catalog.md index c0961d561..60466ed23 100644 --- a/docs/tutorials/add-catalog.md +++ b/docs/tutorials/add-catalog.md @@ -32,7 +32,7 @@ This catalog is distributed as an image [quay.io/operatorhubio/catalog](https:// name: operatorhubio spec: source: - type: image + type: Image image: ref: pollInterval: @@ -54,10 +54,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: @@ -94,7 +94,7 @@ This catalog is distributed as an image [quay.io/operatorhubio/catalog](https:// ``` terminal title="Example output" Name: operatorhubio Namespace: - Labels: + Labels: olm.operatorframework.io/metadata.name=operatorhubio Annotations: API Version: olm.operatorframework.io/v1alpha1 Kind: ClusterCatalog @@ -106,25 +106,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: + Last Successful Poll Attempt: 2024-03-12T19:35:26Z + Ref: quay.io/operatorhubio/catalog@sha256:dee29aaed76fd1c72b654b9bc8bebc4b48b34fd8d41ece880524dc0c3c1c55ec + Type: Image + Events: ``` diff --git a/docs/tutorials/install-extension.md b/docs/tutorials/install-extension.md index ffd28519f..4841bb518 100644 --- a/docs/tutorials/install-extension.md +++ b/docs/tutorials/install-extension.md @@ -10,7 +10,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](../project/olmv1_limitations.md) to be installed * An existing namespace in which to install the extension diff --git a/go.mod b/go.mod index 2af8e39b3..bf049d9d9 100644 --- a/go.mod +++ b/go.mod @@ -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 @@ -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 diff --git a/go.sum b/go.sum index adce30d7c..4d792213c 100644 --- a/go.sum +++ b/go.sum @@ -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= @@ -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= diff --git a/hack/tools/catalogs/README.md b/hack/tools/catalogs/README.md index 00360a17e..8133769bb 100644 --- a/hack/tools/catalogs/README.md +++ b/hack/tools/catalogs/README.md @@ -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: diff --git a/hack/tools/catalogs/download-catalog b/hack/tools/catalogs/download-catalog index 8e997215f..43877690e 100755 --- a/hack/tools/catalogs/download-catalog +++ b/hack/tools/catalogs/download-catalog @@ -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 @@ -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" \ No newline at end of file +echo "Catalog downloaded to ${CATALOG_NAME}-catalog.json" diff --git a/internal/catalogmetadata/cache/cache.go b/internal/catalogmetadata/cache/cache.go index 70dbe51f8..e612c59cf 100644 --- a/internal/catalogmetadata/cache/cache.go +++ b/internal/catalogmetadata/cache/cache.go @@ -28,8 +28,8 @@ func NewFilesystemCache(cachePath string) *filesystemCache { // making decisions on when to attempt to refresh // the cache. type cacheData struct { - ResolvedRef string - Error error + Ref string + Error error } // FilesystemCache is a cache that @@ -78,8 +78,8 @@ func (fsc *filesystemCache) Put(catalogName, resolvedRef string, source io.Reade cacheFS, errToCache = fsc.writeFS(catalogName, source) } fsc.cacheDataByCatalogName[catalogName] = cacheData{ - ResolvedRef: resolvedRef, - Error: errToCache, + Ref: resolvedRef, + Error: errToCache, } return cacheFS, errToCache @@ -144,7 +144,7 @@ func (fsc *filesystemCache) Get(catalogName, resolvedRef string) (fs.FS, error) func (fsc *filesystemCache) get(catalogName, resolvedRef string) (fs.FS, error) { cacheDir := fsc.cacheDir(catalogName) if data, ok := fsc.cacheDataByCatalogName[catalogName]; ok { - if resolvedRef == data.ResolvedRef { + if resolvedRef == data.Ref { if data.Error != nil { return nil, data.Error } diff --git a/internal/catalogmetadata/client/client.go b/internal/catalogmetadata/client/client.go index 50033fdb2..43b972095 100644 --- a/internal/catalogmetadata/client/client.go +++ b/internal/catalogmetadata/client/client.go @@ -58,7 +58,7 @@ func (c *Client) GetPackage(ctx context.Context, catalog *catalogd.ClusterCatalo return nil, err } - catalogFsys, err := c.cache.Get(catalog.Name, catalog.Status.ResolvedSource.Image.ResolvedRef) + catalogFsys, err := c.cache.Get(catalog.Name, catalog.Status.ResolvedSource.Image.Ref) if err != nil { return nil, fmt.Errorf("error retrieving catalog cache: %v", err) } @@ -100,16 +100,16 @@ func (c *Client) PopulateCache(ctx context.Context, catalog *catalogd.ClusterCat if err != nil { // Any errors from the http request we want to cache // so later on cache get they can be bubbled up to the user. - return c.cache.Put(catalog.Name, catalog.Status.ResolvedSource.Image.ResolvedRef, nil, err) + return c.cache.Put(catalog.Name, catalog.Status.ResolvedSource.Image.Ref, nil, err) } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { errToCache := fmt.Errorf("error: received unexpected response status code %d", resp.StatusCode) - return c.cache.Put(catalog.Name, catalog.Status.ResolvedSource.Image.ResolvedRef, nil, errToCache) + return c.cache.Put(catalog.Name, catalog.Status.ResolvedSource.Image.Ref, nil, errToCache) } - return c.cache.Put(catalog.Name, catalog.Status.ResolvedSource.Image.ResolvedRef, resp.Body, nil) + return c.cache.Put(catalog.Name, catalog.Status.ResolvedSource.Image.Ref, resp.Body, nil) } func (c *Client) doRequest(ctx context.Context, catalog *catalogd.ClusterCatalog) (*http.Response, error) { @@ -136,7 +136,7 @@ func validateCatalog(catalog *catalogd.ClusterCatalog) error { return fmt.Errorf("error: provided catalog must be non-nil") } - // if the catalog has not been successfully unpacked, report an error. This ensures that our + // if the catalog is not being served, report an error. This ensures that our // reconciles are deterministic and wait for all desired catalogs to be ready. if !meta.IsStatusConditionPresentAndEqual(catalog.Status.Conditions, catalogd.TypeServing, metav1.ConditionTrue) { return fmt.Errorf("catalog %q is not being served", catalog.Name) diff --git a/internal/catalogmetadata/client/client_test.go b/internal/catalogmetadata/client/client_test.go index a1cec5d4a..2d9c98f36 100644 --- a/internal/catalogmetadata/client/client_test.go +++ b/internal/catalogmetadata/client/client_test.go @@ -25,7 +25,7 @@ func defaultCatalog() *catalogd.ClusterCatalog { Status: catalogd.ClusterCatalogStatus{ Conditions: []metav1.Condition{{Type: catalogd.TypeServing, Status: metav1.ConditionTrue}}, ResolvedSource: &catalogd.ResolvedCatalogSource{Image: &catalogd.ResolvedImageSource{ - ResolvedRef: "fake/catalog@sha256:fakesha", + Ref: "fake/catalog@sha256:fakesha", }}, ContentURL: "https://fake-url.svc.local/all.json", }, @@ -46,7 +46,7 @@ func TestClientGetPackage(t *testing.T) { } for _, tc := range []testCase{ { - name: "not unpacked", + name: "not served", catalog: func() *catalogd.ClusterCatalog { return &catalogd.ClusterCatalog{ObjectMeta: metav1.ObjectMeta{Name: "catalog-1"}} }, @@ -55,7 +55,7 @@ func TestClientGetPackage(t *testing.T) { }, }, { - name: "unpacked, cache returns error", + name: "served, cache returns error", catalog: defaultCatalog, cache: &fakeCache{getErr: errors.New("fetch error")}, assert: func(t *testing.T, dc *declcfg.DeclarativeConfig, err error) { @@ -63,7 +63,7 @@ func TestClientGetPackage(t *testing.T) { }, }, { - name: "unpacked, invalid package path", + name: "served, invalid package path", catalog: defaultCatalog, cache: &fakeCache{getFS: testFS}, pkgName: "/", @@ -72,7 +72,7 @@ func TestClientGetPackage(t *testing.T) { }, }, { - name: "unpacked, package missing", + name: "served, package missing", catalog: defaultCatalog, pkgName: "pkg-missing", cache: &fakeCache{getFS: testFS}, @@ -82,7 +82,7 @@ func TestClientGetPackage(t *testing.T) { }, }, { - name: "unpacked, invalid package present", + name: "served, invalid package present", catalog: defaultCatalog, pkgName: "invalid-pkg-present", cache: &fakeCache{getFS: fstest.MapFS{ @@ -94,7 +94,7 @@ func TestClientGetPackage(t *testing.T) { }, }, { - name: "unpacked, package present", + name: "served, package present", catalog: defaultCatalog, pkgName: "pkg-present", cache: &fakeCache{getFS: testFS}, @@ -182,7 +182,7 @@ func TestClientPopulateCache(t *testing.T) { }, }, { - name: "not unpacked", + name: "not served", catalog: func() *catalogd.ClusterCatalog { return &catalogd.ClusterCatalog{ObjectMeta: metav1.ObjectMeta{Name: "catalog-1"}} }, diff --git a/internal/controllers/clusterextension_controller.go b/internal/controllers/clusterextension_controller.go index 65cb2eaf6..2601d97f0 100644 --- a/internal/controllers/clusterextension_controller.go +++ b/internal/controllers/clusterextension_controller.go @@ -416,7 +416,7 @@ func (r *ClusterExtensionReconciler) SetupWithManager(mgr ctrl.Manager) error { if oldObject.Status.ResolvedSource != nil && newObject.Status.ResolvedSource != nil { if oldObject.Status.ResolvedSource.Image != nil && newObject.Status.ResolvedSource.Image != nil { - return oldObject.Status.ResolvedSource.Image.ResolvedRef != newObject.Status.ResolvedSource.Image.ResolvedRef + return oldObject.Status.ResolvedSource.Image.Ref != newObject.Status.ResolvedSource.Image.Ref } } return true diff --git a/test/upgrade-e2e/post_upgrade_test.go b/test/upgrade-e2e/post_upgrade_test.go index 8bb2ae3df..1e61e4151 100644 --- a/test/upgrade-e2e/post_upgrade_test.go +++ b/test/upgrade-e2e/post_upgrade_test.go @@ -63,7 +63,7 @@ func TestClusterExtensionAfterOLMUpgrade(t *testing.T) { require.NoError(t, err) require.True(t, found) - t.Log("Checking that the ClusterCatalog is unpacked") + t.Log("Checking that the ClusterCatalog is serving") require.EventuallyWithT(t, func(ct *assert.CollectT) { var clusterCatalog catalogdv1alpha1.ClusterCatalog assert.NoError(ct, c.Get(ctx, types.NamespacedName{Name: testClusterCatalogName}, &clusterCatalog))