Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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) {

Check failure on line 42 in internal/catalogmetadata/client/client.go

View workflow job for this annotation

GitHub Actions / e2e-kind

undefined: catalogd.TypeServing

Check failure on line 42 in internal/catalogmetadata/client/client.go

View workflow job for this annotation

GitHub Actions / goreleaser

undefined: catalogd.TypeServing

Check failure on line 42 in internal/catalogmetadata/client/client.go

View workflow job for this annotation

GitHub Actions / unit-test-basic

undefined: catalogd.TypeServing

Check failure on line 42 in internal/catalogmetadata/client/client.go

View workflow job for this annotation

GitHub Actions / lint

undefined: catalogd.TypeServing (typecheck)

Check failure on line 42 in internal/catalogmetadata/client/client.go

View workflow job for this annotation

GitHub Actions / lint

undefined: catalogd.TypeServing) (typecheck)

Check failure on line 42 in internal/catalogmetadata/client/client.go

View workflow job for this annotation

GitHub Actions / lint

undefined: catalogd.TypeServing) (typecheck)

Check failure on line 42 in internal/catalogmetadata/client/client.go

View workflow job for this annotation

GitHub Actions / lint

undefined: catalogd.TypeServing) (typecheck)

Check failure on line 42 in internal/catalogmetadata/client/client.go

View workflow job for this annotation

GitHub Actions / verify

undefined: catalogd.TypeServing

Check failure on line 42 in internal/catalogmetadata/client/client.go

View workflow job for this annotation

GitHub Actions / extension-developer-e2e

undefined: catalogd.TypeServing

Check failure on line 42 in internal/catalogmetadata/client/client.go

View workflow job for this annotation

GitHub Actions / upgrade-e2e

undefined: catalogd.TypeServing
return nil, fmt.Errorf("catalog %q is not yet 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 @@ -13,7 +13,7 @@
catalogd "github.com/operator-framework/catalogd/api/core/v1alpha1"
"github.com/operator-framework/operator-registry/alpha/declcfg"

catalogClient "github.com/operator-framework/operator-controller/internal/catalogmetadata/client"

Check failure on line 16 in internal/catalogmetadata/client/client_test.go

View workflow job for this annotation

GitHub Actions / lint

could not import github.com/operator-framework/operator-controller/internal/catalogmetadata/client (-: # github.com/operator-framework/operator-controller/internal/catalogmetadata/client
)

func TestClientNew(t *testing.T) {
Expand All @@ -34,13 +34,13 @@
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 yet 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}}},

Check failure on line 43 in internal/catalogmetadata/client/client_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: catalogd.TypeServing (typecheck)
},
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 @@
{
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}}},

Check failure on line 53 in internal/catalogmetadata/client/client_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: catalogd.TypeServing (typecheck)
},
fetcher: fetcherFunc(func(context.Context, *catalogd.ClusterCatalog) (fs.FS, error) { return testFS, nil }),
pkgName: "/",
Expand All @@ -61,7 +61,7 @@
{
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}}},

Check failure on line 64 in internal/catalogmetadata/client/client_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: catalogd.TypeServing (typecheck)
},
pkgName: "pkg-missing",
fetcher: fetcherFunc(func(context.Context, *catalogd.ClusterCatalog) (fs.FS, error) { return testFS, nil }),
Expand All @@ -73,7 +73,7 @@
{
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 @@
{
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
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
Loading