diff --git a/docs/Tasks/adding-a-catalog.md b/docs/Tasks/adding-a-catalog.md index 12d07adbf..8158f0d4a 100644 --- a/docs/Tasks/adding-a-catalog.md +++ b/docs/Tasks/adding-a-catalog.md @@ -113,7 +113,7 @@ This catalog is distributed as an image [quay.io/operatorhubio/catalog](https:// Reason: UnpackSuccessful Status: True Type: Unpacked - Content URL: https://catalogd-catalogserver.olmv1-system.svc/catalogs/operatorhubio/all.json + Content URL: https://catalogd-server.olmv1-system.svc/catalogs/operatorhubio/all.json Observed Generation: 2 Resolved Source: Image: diff --git a/go.mod b/go.mod index 2cfba4906..8079963ad 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,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.28.0 + github.com/operator-framework/catalogd v0.29.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 diff --git a/go.sum b/go.sum index 39fb376d8..5c9316e6f 100644 --- a/go.sum +++ b/go.sum @@ -537,8 +537,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.28.0 h1:4M8Jpe443EAWJ2L0knTidq3haM+ac6seT+0IrAGULng= -github.com/operator-framework/catalogd v0.28.0/go.mod h1:cikCg3BwFMyMrRhMXN6cxpv03Cm/EMV3rHX5yi2w8vo= +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/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/download-catalog b/hack/tools/catalogs/download-catalog index cfb7e51a9..8e997215f 100755 --- a/hack/tools/catalogs/download-catalog +++ b/hack/tools/catalogs/download-catalog @@ -8,7 +8,7 @@ assert-commands kubectl jq wget # ClusterCatalog coordinates : "${CATALOGD_CATALOGD_SERVICE_NAMESPACE:=olmv1-system}" -: "${CATALOGD_SERVICE_NAME:=catalogd-catalogserver}" +: "${CATALOGD_SERVICE_NAME:=catalogd-server}" : "${CATALOGD_SERVICE_PORT:=443}" # Assumes the service uses HTTPS on port 443 : "${CATALOGD_LOCAL_SERVICE_PORT:=8001}" diff --git a/internal/catalogmetadata/client/client.go b/internal/catalogmetadata/client/client.go index 2b0663d48..6a9efe285 100644 --- a/internal/catalogmetadata/client/client.go +++ b/internal/catalogmetadata/client/client.go @@ -39,8 +39,8 @@ type Client struct { func (c *Client) GetPackage(ctx context.Context, catalog *catalogd.ClusterCatalog, pkgName string) (*declcfg.DeclarativeConfig, error) { // if the catalog has not been successfully unpacked, 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.TypeUnpacked, metav1.ConditionTrue) { - return nil, fmt.Errorf("catalog %q is not unpacked", catalog.Name) + if !meta.IsStatusConditionPresentAndEqual(catalog.Status.Conditions, catalogd.TypeServing, metav1.ConditionTrue) { + return nil, fmt.Errorf("catalog %q is not being served", catalog.Name) } catalogFsys, err := c.fetcher.FetchCatalogContents(ctx, catalog) diff --git a/internal/catalogmetadata/client/client_test.go b/internal/catalogmetadata/client/client_test.go index beacc4512..989b66acc 100644 --- a/internal/catalogmetadata/client/client_test.go +++ b/internal/catalogmetadata/client/client_test.go @@ -34,13 +34,13 @@ func TestClientNew(t *testing.T) { catalog: &catalogd.ClusterCatalog{ObjectMeta: metav1.ObjectMeta{Name: "catalog-1"}}, fetcher: fetcherFunc(func(context.Context, *catalogd.ClusterCatalog) (fs.FS, error) { return testFS, nil }), assert: func(t *testing.T, dc *declcfg.DeclarativeConfig, err error) { - assert.ErrorContains(t, err, `catalog "catalog-1" is not unpacked`) + assert.ErrorContains(t, err, `catalog "catalog-1" is not being served`) }, }, { name: "unpacked, fetcher returns error", catalog: &catalogd.ClusterCatalog{ - Status: catalogd.ClusterCatalogStatus{Conditions: []metav1.Condition{{Type: catalogd.TypeUnpacked, Status: metav1.ConditionTrue}}}, + Status: catalogd.ClusterCatalogStatus{Conditions: []metav1.Condition{{Type: catalogd.TypeServing, Status: metav1.ConditionTrue}}}, }, fetcher: fetcherFunc(func(context.Context, *catalogd.ClusterCatalog) (fs.FS, error) { return nil, errors.New("fetch error") }), assert: func(t *testing.T, dc *declcfg.DeclarativeConfig, err error) { @@ -50,7 +50,7 @@ func TestClientNew(t *testing.T) { { name: "unpacked, invalid package path", catalog: &catalogd.ClusterCatalog{ - Status: catalogd.ClusterCatalogStatus{Conditions: []metav1.Condition{{Type: catalogd.TypeUnpacked, Status: metav1.ConditionTrue}}}, + Status: catalogd.ClusterCatalogStatus{Conditions: []metav1.Condition{{Type: catalogd.TypeServing, Status: metav1.ConditionTrue}}}, }, fetcher: fetcherFunc(func(context.Context, *catalogd.ClusterCatalog) (fs.FS, error) { return testFS, nil }), pkgName: "/", @@ -61,7 +61,7 @@ func TestClientNew(t *testing.T) { { name: "unpacked, package missing", catalog: &catalogd.ClusterCatalog{ - Status: catalogd.ClusterCatalogStatus{Conditions: []metav1.Condition{{Type: catalogd.TypeUnpacked, Status: metav1.ConditionTrue}}}, + Status: catalogd.ClusterCatalogStatus{Conditions: []metav1.Condition{{Type: catalogd.TypeServing, Status: metav1.ConditionTrue}}}, }, pkgName: "pkg-missing", fetcher: fetcherFunc(func(context.Context, *catalogd.ClusterCatalog) (fs.FS, error) { return testFS, nil }), @@ -73,7 +73,7 @@ func TestClientNew(t *testing.T) { { name: "unpacked, invalid package present", catalog: &catalogd.ClusterCatalog{ - Status: catalogd.ClusterCatalogStatus{Conditions: []metav1.Condition{{Type: catalogd.TypeUnpacked, Status: metav1.ConditionTrue}}}, + Status: catalogd.ClusterCatalogStatus{Conditions: []metav1.Condition{{Type: catalogd.TypeServing, Status: metav1.ConditionTrue}}}, }, pkgName: "invalid-pkg-present", fetcher: fetcherFunc(func(context.Context, *catalogd.ClusterCatalog) (fs.FS, error) { @@ -89,7 +89,7 @@ func TestClientNew(t *testing.T) { { name: "unpacked, package present", catalog: &catalogd.ClusterCatalog{ - Status: catalogd.ClusterCatalogStatus{Conditions: []metav1.Condition{{Type: catalogd.TypeUnpacked, Status: metav1.ConditionTrue}}}, + Status: catalogd.ClusterCatalogStatus{Conditions: []metav1.Condition{{Type: catalogd.TypeServing, Status: metav1.ConditionTrue}}}, }, pkgName: "pkg-present", fetcher: fetcherFunc(func(context.Context, *catalogd.ClusterCatalog) (fs.FS, error) { return testFS, nil }), diff --git a/scripts/install.tpl.sh b/scripts/install.tpl.sh index e4f95b431..e8c857266 100644 --- a/scripts/install.tpl.sh +++ b/scripts/install.tpl.sh @@ -51,7 +51,7 @@ kubectl_wait "olmv1-system" "deployment/catalogd-controller-manager" "60s" if [[ "${install_default_catalogs,,}" != "false" ]]; then kubectl apply -f "https://github.com/operator-framework/catalogd/releases/download/${catalogd_version}/default-catalogs.yaml" - kubectl wait --for=condition=Unpacked "clustercatalog/operatorhubio" --timeout="60s" + kubectl wait --for=condition=Serving "clustercatalog/operatorhubio" --timeout="60s" fi kubectl apply -f "${operator_controller_manifest}" diff --git a/test/e2e/cluster_extension_install_test.go b/test/e2e/cluster_extension_install_test.go index 0798ded08..58e1b3011 100644 --- a/test/e2e/cluster_extension_install_test.go +++ b/test/e2e/cluster_extension_install_test.go @@ -614,12 +614,12 @@ func TestClusterExtensionInstallReResolvesWhenCatalogIsPatched(t *testing.T) { require.NoError(t, err) require.EventuallyWithT(t, func(ct *assert.CollectT) { assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: extensionCatalog.Name}, extensionCatalog)) - cond := apimeta.FindStatusCondition(extensionCatalog.Status.Conditions, catalogd.TypeUnpacked) + cond := apimeta.FindStatusCondition(extensionCatalog.Status.Conditions, catalogd.TypeServing) if !assert.NotNil(ct, cond) { return } assert.Equal(ct, metav1.ConditionTrue, cond.Status) - assert.Equal(ct, catalogd.ReasonUnpackSuccessful, cond.Reason) + assert.Equal(ct, catalogd.ReasonAvailable, cond.Reason) }, pollDuration, pollInterval) t.Log("By eventually reporting a successful resolution and bundle path") @@ -714,12 +714,12 @@ func TestClusterExtensionInstallReResolvesWhenNewCatalog(t *testing.T) { require.NoError(t, err) require.EventuallyWithT(t, func(ct *assert.CollectT) { assert.NoError(ct, c.Get(context.Background(), types.NamespacedName{Name: extensionCatalog.Name}, extensionCatalog)) - cond := apimeta.FindStatusCondition(extensionCatalog.Status.Conditions, catalogd.TypeUnpacked) + cond := apimeta.FindStatusCondition(extensionCatalog.Status.Conditions, catalogd.TypeServing) if !assert.NotNil(ct, cond) { return } assert.Equal(ct, metav1.ConditionTrue, cond.Status) - assert.Equal(ct, catalogd.ReasonUnpackSuccessful, cond.Reason) + assert.Equal(ct, catalogd.ReasonAvailable, cond.Reason) }, pollDuration, pollInterval) t.Log("By eventually reporting a successful resolution and bundle path") diff --git a/test/upgrade-e2e/post_upgrade_test.go b/test/upgrade-e2e/post_upgrade_test.go index 751730b8a..06f9a31b0 100644 --- a/test/upgrade-e2e/post_upgrade_test.go +++ b/test/upgrade-e2e/post_upgrade_test.go @@ -67,12 +67,12 @@ func TestClusterExtensionAfterOLMUpgrade(t *testing.T) { require.EventuallyWithT(t, func(ct *assert.CollectT) { var clusterCatalog catalogdv1alpha1.ClusterCatalog assert.NoError(ct, c.Get(ctx, types.NamespacedName{Name: testClusterCatalogName}, &clusterCatalog)) - cond := apimeta.FindStatusCondition(clusterCatalog.Status.Conditions, catalogdv1alpha1.TypeUnpacked) + cond := apimeta.FindStatusCondition(clusterCatalog.Status.Conditions, catalogdv1alpha1.TypeServing) if !assert.NotNil(ct, cond) { return } assert.Equal(ct, metav1.ConditionTrue, cond.Status) - assert.Equal(ct, catalogdv1alpha1.ReasonUnpackSuccessful, cond.Reason) + assert.Equal(ct, catalogdv1alpha1.ReasonAvailable, cond.Reason) }, time.Minute, time.Second) t.Log("Checking that the ClusterExtension is installed")