Repository: redhat-openshift-ecosystem/openshift-preflight
Pull request #651 (2022-05-19 18:38:45)

normalize docker registries to `docker.io` for the cert image
- Fixes: #650 
- It seems some of the backend processes use `project` level data and some use `image` level data, and the tools they use do not normalize this information, so we need to normalize it beforehand.
- I probably should have listened to @komish when I normalized the `project` level data, but in my testing everything worked fine and I was worried we break something. 🤷🏻 

 
Signed-off-by: Adam D. Cornett <adc@redhat.com>


Patch:
diff --git a/certification/internal/engine/engine.go b/certification/internal/engine/engine.go
index c4a93ae..5f9dce1 100644
--- a/certification/internal/engine/engine.go
+++ b/certification/internal/engine/engine.go
@@ -25,6 +25,7 @@ import (
 	"github.com/redhat-openshift-ecosystem/openshift-preflight/certification/artifacts"
 	"github.com/redhat-openshift-ecosystem/openshift-preflight/certification/errors"
 	"github.com/redhat-openshift-ecosystem/openshift-preflight/certification/internal/authn"
+	"github.com/redhat-openshift-ecosystem/openshift-preflight/certification/internal/openshift"
 	"github.com/redhat-openshift-ecosystem/openshift-preflight/certification/internal/rpm"
 	"github.com/redhat-openshift-ecosystem/openshift-preflight/certification/pyxis"
 	"github.com/redhat-openshift-ecosystem/openshift-preflight/certification/runtime"
@@ -144,7 +145,7 @@ func (c *CraneEngine) ExecuteChecks(ctx context.Context) error {
 
 	if c.IsBundle {
 		// Record test cluster version
-		c.results.TestedOn, err = GetOpenshiftClusterVersion()
+		c.results.TestedOn, err = openshift.GetOpenshiftClusterVersion()
 		if err != nil {
 			log.Error("Unable to determine test cluster version: ", err)
 		}
diff --git a/certification/internal/engine/openshift.go b/certification/internal/openshift/openshift.go
similarity index 82%
rename from certification/internal/engine/openshift.go
rename to certification/internal/openshift/openshift.go
index a210a67..cb1b453 100644
--- a/certification/internal/engine/openshift.go
+++ b/certification/internal/openshift/openshift.go
@@ -1,4 +1,4 @@
-package engine
+package openshift
 
 import (
 	"context"
@@ -12,23 +12,41 @@ import (
 	corev1 "k8s.io/api/core/v1"
 	rbacv1 "k8s.io/api/rbac/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+	apiruntime "k8s.io/apimachinery/pkg/runtime"
 	crclient "sigs.k8s.io/controller-runtime/pkg/client"
-
-	"github.com/redhat-openshift-ecosystem/openshift-preflight/certification/internal/cli"
 )
 
-type openshiftEngine struct {
+type openshiftClient struct {
 	Client crclient.Client
 }
 
-func NewOpenshiftEngine(client crclient.Client) *cli.OpenshiftEngine {
-	var engine cli.OpenshiftEngine = &openshiftEngine{
+// NewClient provides a wrapper around the passed in client in
+// order to present convenience functions for each of the object
+// types that are interacted with.
+func NewClient(client crclient.Client) Client {
+	var osclient Client = &openshiftClient{
 		Client: client,
 	}
-	return &engine
+	return osclient
+}
+
+func AddSchemes(scheme *apiruntime.Scheme) error {
+	if err := operatorv1.AddToScheme(scheme); err != nil {
+		return err
+	}
+	if err := operatorv1alpha1.AddToScheme(scheme); err != nil {
+		return err
+	}
+	if err := imagestreamv1.AddToScheme(scheme); err != nil {
+		return err
+	}
+	if err := rbacv1.AddToScheme(scheme); err != nil {
+		return err
+	}
+	return nil
 }
 
-func (oe *openshiftEngine) CreateNamespace(ctx context.Context, name string) (*corev1.Namespace, error) {
+func (oe *openshiftClient) CreateNamespace(ctx context.Context, name string) (*corev1.Namespace, error) {
 	nsSpec := corev1.Namespace{
 		ObjectMeta: metav1.ObjectMeta{
 			Name: name,
@@ -43,7 +61,7 @@ func (oe *openshiftEngine) CreateNamespace(ctx context.Context, name string) (*c
 	return &nsSpec, nil
 }
 
-func (oe *openshiftEngine) DeleteNamespace(ctx context.Context, name string) error {
+func (oe *openshiftClient) DeleteNamespace(ctx context.Context, name string) error {
 	log.Debugf("Deleting namespace: %s", name)
 	nsSpec := corev1.Namespace{
 		ObjectMeta: metav1.ObjectMeta{
@@ -53,7 +71,7 @@ func (oe *openshiftEngine) DeleteNamespace(ctx context.Context, name string) err
 	return oe.Client.Delete(ctx, &nsSpec, &crclient.DeleteOptions{})
 }
 
-func (oe *openshiftEngine) GetNamespace(ctx context.Context, name string) (*corev1.Namespace, error) {
+func (oe *openshiftClient) GetNamespace(ctx context.Context, name string) (*corev1.Namespace, error) {
 	log.Debugf("fetching namespace %s", name)
 	nsSpec := corev1.Namespace{
 		ObjectMeta: metav1.ObjectMeta{
@@ -71,7 +89,7 @@ func (oe *openshiftEngine) GetNamespace(ctx context.Context, name string) (*core
 	return &nsSpec, nil
 }
 
-func (oe *openshiftEngine) CreateOperatorGroup(ctx context.Context, data cli.OperatorGroupData, namespace string) (*operatorv1.OperatorGroup, error) {
+func (oe *openshiftClient) CreateOperatorGroup(ctx context.Context, data OperatorGroupData, namespace string) (*operatorv1.OperatorGroup, error) {
 	log.Debugf("Creating OperatorGroup %s in namespace %s", data.Name, namespace)
 	operatorGroup := &operatorv1.OperatorGroup{
 		ObjectMeta: metav1.ObjectMeta{
@@ -92,7 +110,7 @@ func (oe *openshiftEngine) CreateOperatorGroup(ctx context.Context, data cli.Ope
 	return operatorGroup, nil
 }
 
-func (oe *openshiftEngine) DeleteOperatorGroup(ctx context.Context, name string, namespace string) error {
+func (oe *openshiftClient) DeleteOperatorGroup(ctx context.Context, name string, namespace string) error {
 	log.Debugf("Deleting OperatorGroup %s in namespace %s", name, namespace)
 	operatorGroup := operatorv1.OperatorGroup{
 		ObjectMeta: metav1.ObjectMeta{
@@ -110,7 +128,7 @@ func (oe *openshiftEngine) DeleteOperatorGroup(ctx context.Context, name string,
 	return nil
 }
 
-func (oe *openshiftEngine) GetOperatorGroup(ctx context.Context, name string, namespace string) (*operatorv1.OperatorGroup, error) {
+func (oe *openshiftClient) GetOperatorGroup(ctx context.Context, name string, namespace string) (*operatorv1.OperatorGroup, error) {
 	log.Debugf("fetching operatorgroup %s from namespace %s", name, namespace)
 	operatorGroup := operatorv1.OperatorGroup{}
 	err := oe.Client.Get(ctx, crclient.ObjectKey{
@@ -124,7 +142,7 @@ func (oe *openshiftEngine) GetOperatorGroup(ctx context.Context, name string, na
 	return &operatorGroup, nil
 }
 
-func (oe openshiftEngine) CreateSecret(ctx context.Context, name string, content map[string]string, secretType corev1.SecretType, namespace string) (*corev1.Secret, error) {
+func (oe openshiftClient) CreateSecret(ctx context.Context, name string, content map[string]string, secretType corev1.SecretType, namespace string) (*corev1.Secret, error) {
 	secret := corev1.Secret{
 		TypeMeta: metav1.TypeMeta{
 			Kind:       "Secret",
@@ -147,7 +165,7 @@ func (oe openshiftEngine) CreateSecret(ctx context.Context, name string, content
 	return &secret, nil
 }
 
-func (oe openshiftEngine) DeleteSecret(ctx context.Context, name string, namespace string) error {
+func (oe openshiftClient) DeleteSecret(ctx context.Context, name string, namespace string) error {
 	secret := corev1.Secret{
 		ObjectMeta: metav1.ObjectMeta{
 			Name:      name,
@@ -158,7 +176,7 @@ func (oe openshiftEngine) DeleteSecret(ctx context.Context, name string, namespa
 	return oe.Client.Delete(ctx, &secret, &crclient.DeleteOptions{})
 }
 
-func (oe openshiftEngine) GetSecret(ctx context.Context, name string, namespace string) (*corev1.Secret, error) {
+func (oe openshiftClient) GetSecret(ctx context.Context, name string, namespace string) (*corev1.Secret, error) {
 	log.Debugf("fetching secrets %s from namespace %s", name, namespace)
 	secret := corev1.Secret{}
 	err := oe.Client.Get(ctx, crclient.ObjectKey{
@@ -172,7 +190,7 @@ func (oe openshiftEngine) GetSecret(ctx context.Context, name string, namespace
 	return &secret, nil
 }
 
-func (oe openshiftEngine) CreateCatalogSource(ctx context.Context, data cli.CatalogSourceData, namespace string) (*operatorv1alpha1.CatalogSource, error) {
+func (oe openshiftClient) CreateCatalogSource(ctx context.Context, data CatalogSourceData, namespace string) (*operatorv1alpha1.CatalogSource, error) {
 	log.Debugf("Creating CatalogSource %s in namespace %s", data.Name, namespace)
 	catalogSource := &operatorv1alpha1.CatalogSource{
 		ObjectMeta: metav1.ObjectMeta{
@@ -195,7 +213,7 @@ func (oe openshiftEngine) CreateCatalogSource(ctx context.Context, data cli.Cata
 	return catalogSource, nil
 }
 
-func (oe *openshiftEngine) DeleteCatalogSource(ctx context.Context, name string, namespace string) error {
+func (oe *openshiftClient) DeleteCatalogSource(ctx context.Context, name string, namespace string) error {
 	log.Debugf("Deleting CatalogSource %s in namespace %s", name, namespace)
 	catalogSource := operatorv1alpha1.CatalogSource{
 		ObjectMeta: metav1.ObjectMeta{
@@ -212,7 +230,7 @@ func (oe *openshiftEngine) DeleteCatalogSource(ctx context.Context, name string,
 	return nil
 }
 
-func (oe *openshiftEngine) GetCatalogSource(ctx context.Context, name string, namespace string) (*operatorv1alpha1.CatalogSource, error) {
+func (oe *openshiftClient) GetCatalogSource(ctx context.Context, name string, namespace string) (*operatorv1alpha1.CatalogSource, error) {
 	log.Debug("fetching catalogsource: " + name)
 	catalogSource := &operatorv1alpha1.CatalogSource{}
 	err := oe.Client.Get(ctx, crclient.ObjectKey{
@@ -226,7 +244,7 @@ func (oe *openshiftEngine) GetCatalogSource(ctx context.Context, name string, na
 	return catalogSource, nil
 }
 
-func (oe openshiftEngine) CreateSubscription(ctx context.Context, data cli.SubscriptionData, namespace string) (*operatorv1alpha1.Subscription, error) {
+func (oe openshiftClient) CreateSubscription(ctx context.Context, data SubscriptionData, namespace string) (*operatorv1alpha1.Subscription, error) {
 	log.Debugf("Creating Subscription %s in namespace %s", data.Name, namespace)
 	subscription := &operatorv1alpha1.Subscription{
 		ObjectMeta: metav1.ObjectMeta{
@@ -250,7 +268,7 @@ func (oe openshiftEngine) CreateSubscription(ctx context.Context, data cli.Subsc
 	return subscription, nil
 }
 
-func (oe *openshiftEngine) GetSubscription(ctx context.Context, name string, namespace string) (*operatorv1alpha1.Subscription, error) {
+func (oe *openshiftClient) GetSubscription(ctx context.Context, name string, namespace string) (*operatorv1alpha1.Subscription, error) {
 	log.Debugf("fetching subscription %s from namespace %s ", name, namespace)
 	subscription := &operatorv1alpha1.Subscription{}
 	err := oe.Client.Get(ctx, crclient.ObjectKey{
@@ -264,7 +282,7 @@ func (oe *openshiftEngine) GetSubscription(ctx context.Context, name string, nam
 	return subscription, nil
 }
 
-func (oe openshiftEngine) DeleteSubscription(ctx context.Context, name string, namespace string) error {
+func (oe openshiftClient) DeleteSubscription(ctx context.Context, name string, namespace string) error {
 	log.Debugf("Deleting Subscription %s in namespace %s", name, namespace)
 
 	subscription := &operatorv1alpha1.Subscription{
@@ -282,7 +300,7 @@ func (oe openshiftEngine) DeleteSubscription(ctx context.Context, name string, n
 	return nil
 }
 
-func (oe *openshiftEngine) GetCSV(ctx context.Context, name string, namespace string) (*operatorv1alpha1.ClusterServiceVersion, error) {
+func (oe *openshiftClient) GetCSV(ctx context.Context, name string, namespace string) (*operatorv1alpha1.ClusterServiceVersion, error) {
 	log.Debugf("fetching csv %s from namespace %s", name, namespace)
 	csv := &operatorv1alpha1.ClusterServiceVersion{}
 	err := oe.Client.Get(ctx, crclient.ObjectKey{
@@ -293,7 +311,7 @@ func (oe *openshiftEngine) GetCSV(ctx context.Context, name string, namespace st
 	return csv, err
 }
 
-func (oe *openshiftEngine) GetImages(ctx context.Context) (map[string]struct{}, error) {
+func (oe *openshiftClient) GetImages(ctx context.Context) (map[string]struct{}, error) {
 	var pods corev1.PodList
 	err := oe.Client.List(ctx, &pods, &crclient.ListOptions{})
 	if err != nil {
@@ -324,7 +342,7 @@ func (oe *openshiftEngine) GetImages(ctx context.Context) (map[string]struct{},
 	return imageList, nil
 }
 
-func (oe *openshiftEngine) CreateRoleBinding(ctx context.Context, data cli.RoleBindingData, namespace string) (*rbacv1.RoleBinding, error) {
+func (oe *openshiftClient) CreateRoleBinding(ctx context.Context, data RoleBindingData, namespace string) (*rbacv1.RoleBinding, error) {
 	log.Debugf("Creating RoleBinding %s in namespace %s", data.Name, namespace)
 	subjectsObj := make([]rbacv1.Subject, 0, len(data.Subjects))
 	for _, subject := range data.Subjects {
@@ -361,7 +379,7 @@ func (oe *openshiftEngine) CreateRoleBinding(ctx context.Context, data cli.RoleB
 	return &roleBindingObj, nil
 }
 
-func (oe *openshiftEngine) GetRoleBinding(ctx context.Context, name string, namespace string) (*rbacv1.RoleBinding, error) {
+func (oe *openshiftClient) GetRoleBinding(ctx context.Context, name string, namespace string) (*rbacv1.RoleBinding, error) {
 	log.Debugf("fetching RoleBinding %s from namespace %s: ", name, namespace)
 	roleBinding := rbacv1.RoleBinding{
 		TypeMeta: metav1.TypeMeta{
@@ -384,7 +402,7 @@ func (oe *openshiftEngine) GetRoleBinding(ctx context.Context, name string, name
 	return &roleBinding, nil
 }
 
-func (oe *openshiftEngine) DeleteRoleBinding(ctx context.Context, name string, namespace string) error {
+func (oe *openshiftClient) DeleteRoleBinding(ctx context.Context, name string, namespace string) error {
 	log.Debugf("Deleting RoleBinding %s in namespace %s", name, namespace)
 
 	roleBinding := rbacv1.RoleBinding{
diff --git a/certification/internal/engine/openshift_version.go b/certification/internal/openshift/openshift_version.go
similarity index 98%
rename from certification/internal/engine/openshift_version.go
rename to certification/internal/openshift/openshift_version.go
index 7aa5715..5b9c0e1 100644
--- a/certification/internal/engine/openshift_version.go
+++ b/certification/internal/openshift/openshift_version.go
@@ -1,4 +1,4 @@
-package engine
+package openshift
 
 import (
 	"context"
diff --git a/certification/internal/cli/openshift.go b/certification/internal/openshift/types.go
similarity index 98%
rename from certification/internal/cli/openshift.go
rename to certification/internal/openshift/types.go
index b2f9b93..c1fac69 100644
--- a/certification/internal/cli/openshift.go
+++ b/certification/internal/openshift/types.go
@@ -1,4 +1,4 @@
-package cli
+package openshift
 
 import (
 	"context"
@@ -35,7 +35,7 @@ type RoleBindingData struct {
 	Namespace string
 }
 
-type OpenshiftEngine interface {
+type Client interface {
 	CreateNamespace(ctx context.Context, name string) (*corev1.Namespace, error)
 	DeleteNamespace(ctx context.Context, name string) error
 	GetNamespace(ctx context.Context, name string) (*corev1.Namespace, error)
diff --git a/certification/internal/policy/operator/deployable_by_olm.go b/certification/internal/policy/operator/deployable_by_olm.go
index 12e0c01..cbd879d 100644
--- a/certification/internal/policy/operator/deployable_by_olm.go
+++ b/certification/internal/policy/operator/deployable_by_olm.go
@@ -10,12 +10,10 @@ import (
 	"sync"
 	"time"
 
-	imagestreamv1 "github.com/openshift/api/image/v1"
 	operatorv1 "github.com/operator-framework/api/pkg/operators/v1"
 	operatorv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
 	"github.com/spf13/viper"
 	corev1 "k8s.io/api/core/v1"
-	rbacv1 "k8s.io/api/rbac/v1"
 	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
 	"k8s.io/apimachinery/pkg/runtime"
 	apiruntime "k8s.io/apimachinery/pkg/runtime"
@@ -28,7 +26,7 @@ import (
 	pflterr "github.com/redhat-openshift-ecosystem/openshift-preflight/certification/errors"
 	"github.com/redhat-openshift-ecosystem/openshift-preflight/certification/internal/bundle"
 	"github.com/redhat-openshift-ecosystem/openshift-preflight/certification/internal/cli"
-	"github.com/redhat-openshift-ecosystem/openshift-preflight/certification/internal/engine"
+	"github.com/redhat-openshift-ecosystem/openshift-preflight/certification/internal/openshift"
 
 	log "github.com/sirupsen/logrus"
 	k8serr "k8s.io/apimachinery/pkg/api/errors"
@@ -48,7 +46,7 @@ type operatorData struct {
 
 type DeployableByOlmCheck struct {
 	OperatorSdkEngine cli.OperatorSdkEngine
-	openshiftEngine   cli.OpenshiftEngine
+	openshiftClient   openshift.Client
 	client            crclient.Client
 	csvReady          bool
 	validImages       bool
@@ -59,10 +57,10 @@ func (p *DeployableByOlmCheck) initClient() error {
 		return nil
 	}
 	scheme := apiruntime.NewScheme()
-	operatorv1.AddToScheme(scheme)
-	operatorv1alpha1.AddToScheme(scheme)
-	imagestreamv1.AddToScheme(scheme)
-	rbacv1.AddToScheme(scheme)
+	if err := openshift.AddSchemes(scheme); err != nil {
+		log.Error(fmt.Errorf("%w: could not add new schemes to client", err))
+		return err
+	}
 	kubeconfig, err := ctrl.GetConfig()
 	if err != nil {
 		log.Error("could not get kubeconfig")
@@ -82,8 +80,8 @@ func (p *DeployableByOlmCheck) initClient() error {
 }
 
 func (p *DeployableByOlmCheck) initOpenShifeEngine() error {
-	if p.openshiftEngine == nil {
-		p.openshiftEngine = *engine.NewOpenshiftEngine(p.client)
+	if p.openshiftClient == nil {
+		p.openshiftClient = openshift.NewClient(p.client)
 	}
 	return nil
 }
@@ -240,11 +238,11 @@ func (p *DeployableByOlmCheck) operatorMetadata(ctx context.Context, bundleRef c
 }
 
 func (p *DeployableByOlmCheck) setUp(ctx context.Context, operatorData *operatorData) error {
-	if _, err := p.openshiftEngine.CreateNamespace(ctx, operatorData.InstallNamespace); err != nil && !k8serr.IsAlreadyExists(err) {
+	if _, err := p.openshiftClient.CreateNamespace(ctx, operatorData.InstallNamespace); err != nil && !k8serr.IsAlreadyExists(err) {
 		return err
 	}
 
-	if _, err := p.openshiftEngine.CreateNamespace(ctx, operatorData.TargetNamespace); err != nil && !k8serr.IsAlreadyExists(err) {
+	if _, err := p.openshiftClient.CreateNamespace(ctx, operatorData.TargetNamespace); err != nil && !k8serr.IsAlreadyExists(err) {
 		return err
 	}
 
@@ -255,7 +253,7 @@ func (p *DeployableByOlmCheck) setUp(ctx context.Context, operatorData *operator
 			return err
 		}
 		data := map[string]string{".dockerconfigjson": string(content)}
-		if _, err := p.openshiftEngine.CreateSecret(ctx, secretName, data, corev1.SecretTypeDockerConfigJson, operatorData.InstallNamespace); err != nil && !k8serr.IsAlreadyExists(err) {
+		if _, err := p.openshiftClient.CreateSecret(ctx, secretName, data, corev1.SecretTypeDockerConfigJson, operatorData.InstallNamespace); err != nil && !k8serr.IsAlreadyExists(err) {
 			return err
 		}
 	} else {
@@ -284,7 +282,7 @@ func (p *DeployableByOlmCheck) setUp(ctx context.Context, operatorData *operator
 		}
 	}
 
-	if _, err := p.openshiftEngine.CreateCatalogSource(ctx, cli.CatalogSourceData{Name: operatorData.App, Image: operatorData.CatalogImage, Secrets: []string{secretName}}, operatorData.InstallNamespace); err != nil && !k8serr.IsAlreadyExists(err) {
+	if _, err := p.openshiftClient.CreateCatalogSource(ctx, openshift.CatalogSourceData{Name: operatorData.App, Image: operatorData.CatalogImage, Secrets: []string{secretName}}, operatorData.InstallNamespace); err != nil && !k8serr.IsAlreadyExists(err) {
 		return err
 	}
 
@@ -292,24 +290,24 @@ func (p *DeployableByOlmCheck) setUp(ctx context.Context, operatorData *operator
 	if err != nil {
 		return err
 	}
-	if _, err := p.openshiftEngine.CreateOperatorGroup(ctx, operatorGroupData, operatorData.InstallNamespace); err != nil && !k8serr.IsAlreadyExists(err) {
+	if _, err := p.openshiftClient.CreateOperatorGroup(ctx, operatorGroupData, operatorData.InstallNamespace); err != nil && !k8serr.IsAlreadyExists(err) {
 		return err
 	}
 
-	subscriptionData := cli.SubscriptionData{
+	subscriptionData := openshift.SubscriptionData{
 		Name:                   operatorData.App,
 		Channel:                operatorData.Channel,
 		CatalogSource:          operatorData.App,
 		CatalogSourceNamespace: operatorData.InstallNamespace,
 		Package:                operatorData.PackageName,
 	}
-	if _, err := p.openshiftEngine.CreateSubscription(ctx, subscriptionData, operatorData.InstallNamespace); err != nil && !k8serr.IsAlreadyExists(err) {
+	if _, err := p.openshiftClient.CreateSubscription(ctx, subscriptionData, operatorData.InstallNamespace); err != nil && !k8serr.IsAlreadyExists(err) {
 		return err
 	}
 	return nil
 }
 
-func (p *DeployableByOlmCheck) generateOperatorGroupData(operatorData *operatorData) (cli.OperatorGroupData, error) {
+func (p *DeployableByOlmCheck) generateOperatorGroupData(operatorData *operatorData) (openshift.OperatorGroupData, error) {
 	var installMode string
 	for i := 0; i < len(prioritizedInstallModes); i++ {
 		if _, ok := operatorData.InstallModes[prioritizedInstallModes[i]]; ok {
@@ -333,27 +331,27 @@ func (p *DeployableByOlmCheck) generateOperatorGroupData(operatorData *operatorD
 	}
 	log.Debugf("The OperatorGroup's TargetNamespaces is %s", targetNamespaces)
 	operatorData.CsvNamespaces = targetNamespaces
-	return cli.OperatorGroupData{Name: operatorData.App, TargetNamespaces: targetNamespaces}, nil
+	return openshift.OperatorGroupData{Name: operatorData.App, TargetNamespaces: targetNamespaces}, nil
 }
 
 func (p *DeployableByOlmCheck) grantRegistryPermissionToServiceAccount(ctx context.Context, serviceAccount, serviceAccountNamespace, indexImageNamespace string) error {
 	for _, role := range []string{registryViewerRole, imagePullerRole} {
-		roleBindingData := cli.RoleBindingData{
+		roleBindingData := openshift.RoleBindingData{
 			Name:      fmt.Sprintf("%s:%s:%s", serviceAccount, serviceAccountNamespace, role),
 			Subjects:  []string{serviceAccount},
 			Role:      role,
 			Namespace: serviceAccountNamespace,
 		}
-		if _, err := p.openshiftEngine.CreateRoleBinding(ctx, roleBindingData, indexImageNamespace); err != nil && !k8serr.IsAlreadyExists(err) {
+		if _, err := p.openshiftClient.CreateRoleBinding(ctx, roleBindingData, indexImageNamespace); err != nil && !k8serr.IsAlreadyExists(err) {
 			return err
 		}
 	}
 	return nil
 }
 
-type watchFunc func(ctx context.Context, engine cli.OpenshiftEngine, name, namespace string) (string, bool, error)
+type watchFunc func(ctx context.Context, client openshift.Client, name, namespace string) (string, bool, error)
 
-func watch(ctx context.Context, engine cli.OpenshiftEngine, wg *sync.WaitGroup, name, namespace string, timeout time.Duration, channel chan string, fn watchFunc) {
+func watch(ctx context.Context, client openshift.Client, wg *sync.WaitGroup, name, namespace string, timeout time.Duration, channel chan string, fn watchFunc) {
 	defer wg.Done()
 
 	ctx, cancel := context.WithTimeout(ctx, timeout)
@@ -361,7 +359,7 @@ func watch(ctx context.Context, engine cli.OpenshiftEngine, wg *sync.WaitGroup,
 
 	for {
 		log.Debugf("Waiting for object %s/%s to become ready...", namespace, name)
-		obj, done, err := fn(ctx, engine, name, namespace)
+		obj, done, err := fn(ctx, client, name, namespace)
 		if err != nil {
 			// Something bad happened. Get out of town
 			log.Errorf("could not retrieve the object %s/%s: %s", namespace, name, err)
@@ -386,8 +384,8 @@ func watch(ctx context.Context, engine cli.OpenshiftEngine, wg *sync.WaitGroup,
 	}
 }
 
-func csvStatusSucceeded(ctx context.Context, engine cli.OpenshiftEngine, name, namespace string) (string, bool, error) {
-	csv, err := engine.GetCSV(ctx, name, namespace)
+func csvStatusSucceeded(ctx context.Context, client openshift.Client, name, namespace string) (string, bool, error) {
+	csv, err := client.GetCSV(ctx, name, namespace)
 	if err != nil && !k8serr.IsNotFound(err) {
 		// This is not a normal error. Get out of town
 		log.Errorf("failed to fetch the csv %s from namespace %s: %s", name, namespace, err)
@@ -416,7 +414,7 @@ func (p *DeployableByOlmCheck) isCSVReady(ctx context.Context, operatorData oper
 
 	for _, CsvNamespace := range CsvNamespaces {
 		wg.Add(1)
-		go watch(ctx, p.openshiftEngine, &wg, operatorData.InstalledCsv, CsvNamespace, csvTimeout, csvChannel, csvStatusSucceeded)
+		go watch(ctx, p.openshiftClient, &wg, operatorData.InstalledCsv, CsvNamespace, csvTimeout, csvChannel, csvStatusSucceeded)
 	}
 
 	go func() {
@@ -435,8 +433,8 @@ func (p *DeployableByOlmCheck) isCSVReady(ctx context.Context, operatorData oper
 	return true, nil
 }
 
-func subscriptionCsvIsInstalled(ctx context.Context, engine cli.OpenshiftEngine, name, namespace string) (string, bool, error) {
-	sub, err := engine.GetSubscription(ctx, name, namespace)
+func subscriptionCsvIsInstalled(ctx context.Context, client openshift.Client, name, namespace string) (string, bool, error) {
+	sub, err := client.GetSubscription(ctx, name, namespace)
 	if err != nil && !k8serr.IsNotFound(err) {
 		log.Errorf("failed to fetch the subscription %s from namespace %s: %s", name, namespace, err)
 		return "", false, err
@@ -456,7 +454,7 @@ func (p *DeployableByOlmCheck) installedCSV(ctx context.Context, operatorData op
 	var wg sync.WaitGroup
 	// query API server for the installed CSV field of the created subscription
 	wg.Add(1)
-	go watch(ctx, p.openshiftEngine, &wg, operatorData.App, operatorData.InstallNamespace, subscriptionTimeout, installedCSVChannel, subscriptionCsvIsInstalled)
+	go watch(ctx, p.openshiftClient, &wg, operatorData.App, operatorData.InstallNamespace, subscriptionTimeout, installedCSVChannel, subscriptionCsvIsInstalled)
 
 	go func() {
 		wg.Wait()
@@ -477,35 +475,35 @@ func (p *DeployableByOlmCheck) installedCSV(ctx context.Context, operatorData op
 func (p *DeployableByOlmCheck) cleanUp(ctx context.Context, operatorData operatorData) {
 	log.Debug("Dumping data in artifacts/ directory")
 
-	subs, err := p.openshiftEngine.GetSubscription(ctx, operatorData.App, operatorData.InstallNamespace)
+	subs, err := p.openshiftClient.GetSubscription(ctx, operatorData.App, operatorData.InstallNamespace)
 	if err != nil {
 		log.Warn("unable to retrieve the subscription")
 	} else {
 		p.writeToFile(subs)
 	}
 
-	cs, err := p.openshiftEngine.GetCatalogSource(ctx, operatorData.App, operatorData.InstallNamespace)
+	cs, err := p.openshiftClient.GetCatalogSource(ctx, operatorData.App, operatorData.InstallNamespace)
 	if err != nil {
 		log.Warn("unable to retrieve the catalogsource")
 	} else {
 		p.writeToFile(cs)
 	}
 
-	og, err := p.openshiftEngine.GetOperatorGroup(ctx, operatorData.App, operatorData.InstallNamespace)
+	og, err := p.openshiftClient.GetOperatorGroup(ctx, operatorData.App, operatorData.InstallNamespace)
 	if err != nil {
 		log.Warn("unable to retrieve the operatorgroup")
 	} else {
 		p.writeToFile(og)
 	}
 
-	installNamespace, err := p.openshiftEngine.GetNamespace(ctx, operatorData.InstallNamespace)
+	installNamespace, err := p.openshiftClient.GetNamespace(ctx, operatorData.InstallNamespace)
 	if err != nil {
 		log.Warn("unable to retrieve the install namespace")
 	} else {
 		p.writeToFile(installNamespace)
 	}
 
-	targetNamespace, err := p.openshiftEngine.GetNamespace(ctx, operatorData.TargetNamespace)
+	targetNamespace, err := p.openshiftClient.GetNamespace(ctx, operatorData.TargetNamespace)
 	if err != nil {
 		log.Warn("unable to retrieve the target namespace")
 	} else {
@@ -513,27 +511,27 @@ func (p *DeployableByOlmCheck) cleanUp(ctx context.Context, operatorData operato
 	}
 
 	log.Trace("Deleting the resources created by DeployableByOLM Check")
-	p.openshiftEngine.DeleteSubscription(ctx, operatorData.App, operatorData.InstallNamespace)
-	p.openshiftEngine.DeleteCatalogSource(ctx, operatorData.App, operatorData.InstallNamespace)
-	p.openshiftEngine.DeleteOperatorGroup(ctx, operatorData.App, operatorData.InstallNamespace)
-	p.openshiftEngine.DeleteSecret(ctx, secretName, operatorData.InstallNamespace)
+	p.openshiftClient.DeleteSubscription(ctx, operatorData.App, operatorData.InstallNamespace)
+	p.openshiftClient.DeleteCatalogSource(ctx, operatorData.App, operatorData.InstallNamespace)
+	p.openshiftClient.DeleteOperatorGroup(ctx, operatorData.App, operatorData.InstallNamespace)
+	p.openshiftClient.DeleteSecret(ctx, secretName, operatorData.InstallNamespace)
 
 	if strings.Contains(operatorData.CatalogImage, imageRegistryService) {
 		indexImageNamespace := strings.Split(operatorData.CatalogImage, "/")[1]
 		operatorServiceAccount := operatorData.App
 		operatorNamespace := operatorData.InstallNamespace
 		// remove pipeline-related rolebindings
-		p.openshiftEngine.DeleteRoleBinding(ctx, fmt.Sprintf("%s:%s:%s", pipelineServiceAccount, operatorNamespace, registryViewerRole), indexImageNamespace)
-		p.openshiftEngine.DeleteRoleBinding(ctx, fmt.Sprintf("%s:%s:%s", pipelineServiceAccount, operatorNamespace, imagePullerRole), indexImageNamespace)
+		p.openshiftClient.DeleteRoleBinding(ctx, fmt.Sprintf("%s:%s:%s", pipelineServiceAccount, operatorNamespace, registryViewerRole), indexImageNamespace)
+		p.openshiftClient.DeleteRoleBinding(ctx, fmt.Sprintf("%s:%s:%s", pipelineServiceAccount, operatorNamespace, imagePullerRole), indexImageNamespace)
 		// remove rolebindings required for the default OperatorHub catalog sources
-		p.openshiftEngine.DeleteRoleBinding(ctx, fmt.Sprintf("%s:%s:%s", operatorServiceAccount, openshiftMarketplaceNamespace, registryViewerRole), indexImageNamespace)
-		p.openshiftEngine.DeleteRoleBinding(ctx, fmt.Sprintf("%s:%s:%s", operatorServiceAccount, openshiftMarketplaceNamespace, imagePullerRole), indexImageNamespace)
+		p.openshiftClient.DeleteRoleBinding(ctx, fmt.Sprintf("%s:%s:%s", operatorServiceAccount, openshiftMarketplaceNamespace, registryViewerRole), indexImageNamespace)
+		p.openshiftClient.DeleteRoleBinding(ctx, fmt.Sprintf("%s:%s:%s", operatorServiceAccount, openshiftMarketplaceNamespace, imagePullerRole), indexImageNamespace)
 		// remove rolebindings required for custom catalog sources
-		p.openshiftEngine.DeleteRoleBinding(ctx, fmt.Sprintf("%s:%s:%s", operatorServiceAccount, operatorNamespace, registryViewerRole), indexImageNamespace)
-		p.openshiftEngine.DeleteRoleBinding(ctx, fmt.Sprintf("%s:%s:%s", operatorServiceAccount, operatorNamespace, imagePullerRole), indexImageNamespace)
+		p.openshiftClient.DeleteRoleBinding(ctx, fmt.Sprintf("%s:%s:%s", operatorServiceAccount, operatorNamespace, registryViewerRole), indexImageNamespace)
+		p.openshiftClient.DeleteRoleBinding(ctx, fmt.Sprintf("%s:%s:%s", operatorServiceAccount, operatorNamespace, imagePullerRole), indexImageNamespace)
 	}
-	p.openshiftEngine.DeleteNamespace(ctx, operatorData.InstallNamespace)
-	p.openshiftEngine.DeleteNamespace(ctx, operatorData.TargetNamespace)
+	p.openshiftClient.DeleteNamespace(ctx, operatorData.InstallNamespace)
+	p.openshiftClient.DeleteNamespace(ctx, operatorData.TargetNamespace)
 }
 
 func (p *DeployableByOlmCheck) writeToFile(data interface{}) error {
@@ -592,7 +590,7 @@ func (p *DeployableByOlmCheck) readFileAsByteArray(filename string) ([]byte, err
 }
 
 func (p *DeployableByOlmCheck) getImages(ctx context.Context) (map[string]struct{}, error) {
-	return p.openshiftEngine.GetImages(ctx)
+	return p.openshiftClient.GetImages(ctx)
 }
 
 func (p *DeployableByOlmCheck) Name() string {
diff --git a/certification/pyxis/submit.go b/certification/pyxis/submit.go
index 14ad6a8..fe959bb 100644
--- a/certification/pyxis/submit.go
+++ b/certification/pyxis/submit.go
@@ -36,14 +36,8 @@ func (p *pyxisClient) SubmitResults(ctx context.Context, certInput *certificatio
 
 	// Set this project's metadata to match the image that we're certifying.
 	if certProject.Container.Registry == "" {
-		// Setting registry to the value we get from certImage from crane and then normalizing
-		// index.docker.io to docker.io so project info shows properly in the Red Hat Catalog
-		registry := certImage.Repositories[0].Registry
-		if registry == name.DefaultRegistry {
-			registry = defaultRegistryAlias
-		}
-
-		certProject.Container.Registry = registry
+		// normalizing index.docker.io to docker.io for the certProject
+		certProject.Container.Registry = normalizeDockerRegistry(certImage.Repositories[0].Registry)
 	}
 
 	if certProject.Container.Repository == "" {
@@ -63,6 +57,9 @@ func (p *pyxisClient) SubmitResults(ctx context.Context, certInput *certificatio
 	// in the event that it exists. createImage will wipe it otherwise.
 	originalImageDigest := certImage.DockerImageDigest
 
+	// normalizing index.docker.io to docker.io for the certImage
+	certImage.Repositories[0].Registry = normalizeDockerRegistry(certImage.Repositories[0].Registry)
+
 	// Create the image, or get it if it already exists.
 	certImage, err = p.createImage(ctx, certImage)
 	if err != nil {
@@ -119,3 +116,13 @@ func (p *pyxisClient) SubmitResults(ctx context.Context, certInput *certificatio
 		TestResults: testResults,
 	}, nil
 }
+
+// normalizeDockerRegistry sets registry to the value we get from certImage from crane and then normalizes
+// index.docker.io to docker.io so project/image info shows properly in the Red Hat Catalog and other backend systems (Clair)
+func normalizeDockerRegistry(registry string) string {
+	if registry == name.DefaultRegistry {
+		registry = defaultRegistryAlias
+	}
+
+	return registry
+}


Test patch:
diff --git a/certification/internal/openshift/openshift_suite_test.go b/certification/internal/openshift/openshift_suite_test.go
new file mode 100644
index 0000000..8be62b3
--- /dev/null
+++ b/certification/internal/openshift/openshift_suite_test.go
@@ -0,0 +1,13 @@
+package openshift
+
+import (
+	"testing"
+
+	. "github.com/onsi/ginkgo/v2"
+	. "github.com/onsi/gomega"
+)
+
+func TestOpenshift(t *testing.T) {
+	RegisterFailHandler(Fail)
+	RunSpecs(t, "Openshift Client Suite")
+}
diff --git a/certification/internal/engine/openshift_test.go b/certification/internal/openshift/openshift_test.go
similarity index 74%
rename from certification/internal/engine/openshift_test.go
rename to certification/internal/openshift/openshift_test.go
index 2bb82cc..adc5614 100644
--- a/certification/internal/engine/openshift_test.go
+++ b/certification/internal/openshift/openshift_test.go
@@ -1,4 +1,4 @@
-package engine
+package openshift
 
 import (
 	"context"
@@ -7,11 +7,8 @@ import (
 	. "github.com/onsi/gomega"
 
 	imagestreamv1 "github.com/openshift/api/image/v1"
-	operatorv1 "github.com/operator-framework/api/pkg/operators/v1"
 	operatorv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
-	"github.com/redhat-openshift-ecosystem/openshift-preflight/certification/internal/cli"
 	corev1 "k8s.io/api/core/v1"
-	rbacv1 "k8s.io/api/rbac/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	apiruntime "k8s.io/apimachinery/pkg/runtime"
 
@@ -19,7 +16,7 @@ import (
 )
 
 var _ = Describe("OpenShift Engine", func() {
-	var oe *openshiftEngine
+	var oc Client
 
 	BeforeEach(func() {
 		pod1 := corev1.Pod{
@@ -96,35 +93,32 @@ var _ = Describe("OpenShift Engine", func() {
 		}
 
 		scheme := apiruntime.NewScheme()
-		Expect(operatorv1.AddToScheme(scheme)).To(Succeed())
-		Expect(operatorv1alpha1.AddToScheme(scheme)).To(Succeed())
-		Expect(imagestreamv1.AddToScheme(scheme)).To(Succeed())
-		Expect(rbacv1.AddToScheme(scheme)).To(Succeed())
+		Expect(AddSchemes(scheme)).To(Succeed())
 		cl := fake.NewClientBuilder().
 			WithScheme(scheme).
 			WithObjects(&csv).
 			WithLists(&pods, &isList).
 			Build()
-		oe = &openshiftEngine{Client: cl}
+		oc = NewClient(cl)
 	})
 	Context("Namespaces", func() {
 		It("should exercise Namespaces", func() {
 			By("creating a Namespace", func() {
-				ns, err := oe.CreateNamespace(context.TODO(), "testns")
+				ns, err := oc.CreateNamespace(context.TODO(), "testns")
 				Expect(err).ToNot(HaveOccurred())
 				Expect(ns).ToNot(BeNil())
 			})
 			By("getting that Namespace", func() {
-				ns, err := oe.GetNamespace(context.TODO(), "testns")
+				ns, err := oc.GetNamespace(context.TODO(), "testns")
 				Expect(err).ToNot(HaveOccurred())
 				Expect(ns).ToNot(BeNil())
 			})
 			By("deleting that Namespace", func() {
-				err := oe.DeleteNamespace(context.TODO(), "testns")
+				err := oc.DeleteNamespace(context.TODO(), "testns")
 				Expect(err).ToNot(HaveOccurred())
 			})
 			By("trying to get it again, but failing", func() {
-				ns, err := oe.GetNamespace(context.TODO(), "testns")
+				ns, err := oc.GetNamespace(context.TODO(), "testns")
 				Expect(err).To(HaveOccurred())
 				Expect(ns).To(BeNil())
 			})
@@ -132,27 +126,27 @@ var _ = Describe("OpenShift Engine", func() {
 	})
 	Context("OperatorGroups", func() {
 		It("should exercise OperatorGroups", func() {
-			operatorGroupData := cli.OperatorGroupData{
+			operatorGroupData := OperatorGroupData{
 				Name:             "testog",
 				TargetNamespaces: []string{"default", "testns"},
 			}
 			By("creating a OperatorGroup", func() {
-				og, err := oe.CreateOperatorGroup(context.TODO(), operatorGroupData, "testns")
+				og, err := oc.CreateOperatorGroup(context.TODO(), operatorGroupData, "testns")
 				Expect(err).ToNot(HaveOccurred())
 				Expect(og).ToNot(BeNil())
 			})
 			By("getting that OperatorGroup", func() {
-				og, err := oe.GetOperatorGroup(context.TODO(), "testog", "testns")
+				og, err := oc.GetOperatorGroup(context.TODO(), "testog", "testns")
 				Expect(err).ToNot(HaveOccurred())
 				Expect(og).ToNot(BeNil())
 				Expect(og.Spec.TargetNamespaces).To(ContainElement("testns"))
 			})
 			By("deleting that OperatorGroup", func() {
-				err := oe.DeleteOperatorGroup(context.TODO(), "testog", "testns")
+				err := oc.DeleteOperatorGroup(context.TODO(), "testog", "testns")
 				Expect(err).ToNot(HaveOccurred())
 			})
 			By("trying to get it again, but failing", func() {
-				og, err := oe.GetOperatorGroup(context.TODO(), "testog", "testns")
+				og, err := oc.GetOperatorGroup(context.TODO(), "testog", "testns")
 				Expect(err).To(HaveOccurred())
 				Expect(og).To(BeNil())
 			})
@@ -163,12 +157,12 @@ var _ = Describe("OpenShift Engine", func() {
 			By("creating a Secret", func() {
 				content := make(map[string]string, 1)
 				content["test"] = "testdata"
-				secret, err := oe.CreateSecret(context.TODO(), "testsecret", content, corev1.SecretTypeDockerConfigJson, "testns")
+				secret, err := oc.CreateSecret(context.TODO(), "testsecret", content, corev1.SecretTypeDockerConfigJson, "testns")
 				Expect(err).ToNot(HaveOccurred())
 				Expect(secret).ToNot(BeNil())
 			})
 			By("getting that Secret", func() {
-				secret, err := oe.GetSecret(context.TODO(), "testsecret", "testns")
+				secret, err := oc.GetSecret(context.TODO(), "testsecret", "testns")
 				Expect(err).ToNot(HaveOccurred())
 				Expect(secret).ToNot(BeNil())
 				// This wouldn't be a readable field in "normal" client operations. But rather
@@ -177,11 +171,11 @@ var _ = Describe("OpenShift Engine", func() {
 				Expect(secret.StringData).To(ContainElement("testdata"))
 			})
 			By("deleting that Secret", func() {
-				err := oe.DeleteSecret(context.TODO(), "testsecret", "testns")
+				err := oc.DeleteSecret(context.TODO(), "testsecret", "testns")
 				Expect(err).ToNot(HaveOccurred())
 			})
 			By("trying to get it again, but failing", func() {
-				secret, err := oe.GetSecret(context.TODO(), "testsecret", "testns")
+				secret, err := oc.GetSecret(context.TODO(), "testsecret", "testns")
 				Expect(err).To(HaveOccurred())
 				Expect(secret).To(BeNil())
 			})
@@ -190,27 +184,27 @@ var _ = Describe("OpenShift Engine", func() {
 	Context("CatalogSources", func() {
 		It("should exercise CatalogSources", func() {
 			By("creating a CatalogSource", func() {
-				csData := cli.CatalogSourceData{
+				csData := CatalogSourceData{
 					Name:    "testcs",
 					Image:   "this/is/my-image:now",
 					Secrets: []string{"my-secrets"},
 				}
-				cs, err := oe.CreateCatalogSource(context.TODO(), csData, "testns")
+				cs, err := oc.CreateCatalogSource(context.TODO(), csData, "testns")
 				Expect(err).ToNot(HaveOccurred())
 				Expect(cs).ToNot(BeNil())
 			})
 			By("getting that CatalogSource", func() {
-				cs, err := oe.GetCatalogSource(context.TODO(), "testcs", "testns")
+				cs, err := oc.GetCatalogSource(context.TODO(), "testcs", "testns")
 				Expect(err).ToNot(HaveOccurred())
 				Expect(cs).ToNot(BeNil())
 				Expect(cs.Spec.Image).To(Equal("this/is/my-image:now"))
 			})
 			By("deleting that CatalogSource", func() {
-				err := oe.DeleteCatalogSource(context.TODO(), "testcs", "testns")
+				err := oc.DeleteCatalogSource(context.TODO(), "testcs", "testns")
 				Expect(err).ToNot(HaveOccurred())
 			})
 			By("trying to get it again, but failing", func() {
-				cs, err := oe.GetCatalogSource(context.TODO(), "testcs", "testns")
+				cs, err := oc.GetCatalogSource(context.TODO(), "testcs", "testns")
 				Expect(err).To(HaveOccurred())
 				Expect(cs).To(BeNil())
 			})
@@ -219,29 +213,29 @@ var _ = Describe("OpenShift Engine", func() {
 	Context("Subscriptions", func() {
 		It("should exercise Subscriptions", func() {
 			By("creating a Subscription", func() {
-				subData := cli.SubscriptionData{
+				subData := SubscriptionData{
 					Name:                   "testsub",
 					Channel:                "testchannel",
 					CatalogSource:          "testcs",
 					CatalogSourceNamespace: "testns",
 					Package:                "testpackage",
 				}
-				sub, err := oe.CreateSubscription(context.TODO(), subData, "testns")
+				sub, err := oc.CreateSubscription(context.TODO(), subData, "testns")
 				Expect(err).ToNot(HaveOccurred())
 				Expect(sub).ToNot(BeNil())
 			})
 			By("getting that Subscription", func() {
-				sub, err := oe.GetSubscription(context.TODO(), "testsub", "testns")
+				sub, err := oc.GetSubscription(context.TODO(), "testsub", "testns")
 				Expect(err).ToNot(HaveOccurred())
 				Expect(sub).ToNot(BeNil())
 				Expect(sub.Spec.Channel).To(Equal("testchannel"))
 			})
 			By("deleting that Subscription", func() {
-				err := oe.DeleteSubscription(context.TODO(), "testsub", "testns")
+				err := oc.DeleteSubscription(context.TODO(), "testsub", "testns")
 				Expect(err).ToNot(HaveOccurred())
 			})
 			By("trying to get it again, but failing", func() {
-				sub, err := oe.GetSubscription(context.TODO(), "testsub", "testns")
+				sub, err := oc.GetSubscription(context.TODO(), "testsub", "testns")
 				Expect(err).To(HaveOccurred())
 				Expect(sub).To(BeNil())
 			})
@@ -250,28 +244,28 @@ var _ = Describe("OpenShift Engine", func() {
 	Context("RoleBindings", func() {
 		It("should exercise RoleBindings", func() {
 			By("creating a RoleBinding", func() {
-				rbData := cli.RoleBindingData{
+				rbData := RoleBindingData{
 					Name:      "testrb",
 					Subjects:  []string{"testsubject"},
 					Role:      "testrole",
 					Namespace: "testns",
 				}
-				rb, err := oe.CreateRoleBinding(context.TODO(), rbData, "testns")
+				rb, err := oc.CreateRoleBinding(context.TODO(), rbData, "testns")
 				Expect(err).ToNot(HaveOccurred())
 				Expect(rb).ToNot(BeNil())
 			})
 			By("getting that RoleBinding", func() {
-				rb, err := oe.GetRoleBinding(context.TODO(), "testrb", "testns")
+				rb, err := oc.GetRoleBinding(context.TODO(), "testrb", "testns")
 				Expect(err).ToNot(HaveOccurred())
 				Expect(rb).ToNot(BeNil())
 				Expect(rb.Name).To(Equal("testrb"))
 			})
 			By("deleting that RoleBinding", func() {
-				err := oe.DeleteRoleBinding(context.TODO(), "testrb", "testns")
+				err := oc.DeleteRoleBinding(context.TODO(), "testrb", "testns")
 				Expect(err).ToNot(HaveOccurred())
 			})
 			By("trying to get it again, but failing", func() {
-				rb, err := oe.GetRoleBinding(context.TODO(), "testrb", "testns")
+				rb, err := oc.GetRoleBinding(context.TODO(), "testrb", "testns")
 				Expect(err).To(HaveOccurred())
 				Expect(rb).To(BeNil())
 			})
@@ -279,14 +273,14 @@ var _ = Describe("OpenShift Engine", func() {
 	})
 	Context("Images", func() {
 		It("should exercise GetImages", func() {
-			images, err := oe.GetImages(context.TODO())
+			images, err := oc.GetImages(context.TODO())
 			Expect(err).ToNot(HaveOccurred())
 			Expect(images).ToNot(BeNil())
 		})
 	})
 	Context("CSVs", func() {
 		It("should exercise GetCSV", func() {
-			csv, err := oe.GetCSV(context.TODO(), "testcsv", "testns")
+			csv, err := oc.GetCSV(context.TODO(), "testcsv", "testns")
 			Expect(err).ToNot(HaveOccurred())
 			Expect(csv).ToNot(BeNil())
 		})
diff --git a/certification/internal/policy/operator/deployable_by_olm_test.go b/certification/internal/policy/operator/deployable_by_olm_test.go
index d427a0a..142a169 100644
--- a/certification/internal/policy/operator/deployable_by_olm_test.go
+++ b/certification/internal/policy/operator/deployable_by_olm_test.go
@@ -10,10 +10,6 @@ import (
 	. "github.com/onsi/gomega"
 
 	fakecranev1 "github.com/google/go-containerregistry/pkg/v1/fake"
-	imagestreamv1 "github.com/openshift/api/image/v1"
-	operatorv1 "github.com/operator-framework/api/pkg/operators/v1"
-	operatorv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
-	rbacv1 "k8s.io/api/rbac/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	apiruntime "k8s.io/apimachinery/pkg/runtime"
 	crclient "sigs.k8s.io/controller-runtime/pkg/client"
@@ -21,6 +17,7 @@ import (
 
 	"github.com/redhat-openshift-ecosystem/openshift-preflight/certification"
 	"github.com/redhat-openshift-ecosystem/openshift-preflight/certification/internal/cli"
+	"github.com/redhat-openshift-ecosystem/openshift-preflight/certification/internal/openshift"
 )
 
 var _ = Describe("DeployableByOLMCheck", func() {
@@ -107,10 +104,7 @@ var _ = Describe("DeployableByOLMCheck", func() {
 		og.Status.LastUpdated = &now
 		deployableByOLMCheck = *NewDeployableByOlmCheck(&fakeEngine)
 		scheme := apiruntime.NewScheme()
-		Expect(operatorv1.AddToScheme(scheme)).To(Succeed())
-		Expect(operatorv1alpha1.AddToScheme(scheme)).To(Succeed())
-		Expect(imagestreamv1.AddToScheme(scheme)).To(Succeed())
-		Expect(rbacv1.AddToScheme(scheme)).To(Succeed())
+		Expect(openshift.AddSchemes(scheme)).To(Succeed())
 		client = fake.NewClientBuilder().
 			WithScheme(scheme).
 			WithObjects(&csv, &csvDefault, &csvMarketplace, &ns, &secret, &sub, &og).
diff --git a/certification/pyxis/pyxis_suite_test.go b/certification/pyxis/pyxis_suite_test.go
index 40f8a2b..9923a79 100644
--- a/certification/pyxis/pyxis_suite_test.go
+++ b/certification/pyxis/pyxis_suite_test.go
@@ -105,6 +105,8 @@ func (p *pyxisImageHandler) ServeHTTP(response http.ResponseWriter, request *htt
 		response.WriteHeader(http.StatusUnauthorized)
 	case request.Method == http.MethodPost && request.Header["X-Api-Key"][0] == "my-bad-500-image-api-token":
 		response.WriteHeader(http.StatusInternalServerError)
+	case request.Header["X-Api-Key"][0] == "my-index-docker-io-project-api-token":
+		mustWrite(response, `{"_id": "blah", "architecture": "amd64", "object_type": "containerImage", "repositories": [ {"published": false, "registry": "docker.io", "repository": "my/repo", "tags": [{"name": "docker_io_v3"}]}]}`)
 	case request.Method == http.MethodPost:
 		mustWrite(response, responseString)
 	default:
diff --git a/certification/pyxis/submit_test.go b/certification/pyxis/submit_test.go
index 5c57626..d0005bc 100644
--- a/certification/pyxis/submit_test.go
+++ b/certification/pyxis/submit_test.go
@@ -112,7 +112,7 @@ var _ = Describe("Pyxis Submit", func() {
 				Expect(err).ToNot(HaveOccurred())
 				Expect(certResults).ToNot(BeNil())
 				Expect(certResults.CertProject.Container.Registry).Should(Equal(defaultRegistryAlias))
-				Expect(certResults.CertImage).ToNot(BeNil())
+				Expect(certResults.CertImage.Repositories[0].Registry).Should(Equal(defaultRegistryAlias))
 				Expect(certResults.TestResults).ToNot(BeNil())
 			})
 		})