Skip to content

Commit

Permalink
🌱 Bump catalogd from v0.28.0 to v0.29.0 (#1288)
Browse files Browse the repository at this point in the history
* 🌱 Bump catalogd from v0.28.0 to v0.29.0

Signed-off-by: Per Goncalves da Silva <[email protected]>

* Update operator-controller for catalogd condition changes

Signed-off-by: Per Goncalves da Silva <[email protected]>

---------

Signed-off-by: Per Goncalves da Silva <[email protected]>
Co-authored-by: Per Goncalves da Silva <[email protected]>
  • Loading branch information
perdasilva and Per Goncalves da Silva authored Sep 20, 2024
1 parent 134386d commit a752f58
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion docs/Tasks/adding-a-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion hack/tools/catalogs/download-catalog
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
4 changes: 2 additions & 2 deletions internal/catalogmetadata/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions internal/catalogmetadata/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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: "/",
Expand All @@ -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 }),
Expand All @@ -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) {
Expand All @@ -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 }),
Expand Down
2 changes: 1 addition & 1 deletion scripts/install.tpl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/cluster_extension_install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions test/upgrade-e2e/post_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit a752f58

Please sign in to comment.