Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
EVEREST-838 fix incorrect namespace for GetPackageManifest
Browse files Browse the repository at this point in the history
  • Loading branch information
recharte committed Feb 14, 2024
1 parent e2186f2 commit 0538005
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
7 changes: 3 additions & 4 deletions pkg/kubernetes/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1279,9 +1279,9 @@ func (c *Client) GetInstallPlan(ctx context.Context, namespace string, name stri
}

// DoPackageWait for the package to be available in OLM.
func (c *Client) DoPackageWait(ctx context.Context, name string) error {
func (c *Client) DoPackageWait(ctx context.Context, namespace, name string) error {
packageInstalled := func(ctx context.Context) (bool, error) {
_, err := c.GetPackageManifest(ctx, name)
_, err := c.GetPackageManifest(ctx, namespace, name)
if err != nil {
if apierrors.ReasonForError(err) == metav1.StatusReasonUnknown {
return false, err
Expand All @@ -1294,8 +1294,7 @@ func (c *Client) DoPackageWait(ctx context.Context, name string) error {
}

// GetPackageManifest returns a package manifest by given name.
func (c *Client) GetPackageManifest(ctx context.Context, name string) (*packagev1.PackageManifest, error) {
namespace := "olm"
func (c *Client) GetPackageManifest(ctx context.Context, namespace, name string) (*packagev1.PackageManifest, error) {
operatorClient, err := packageServerClient.NewForConfig(c.restConfig)
if err != nil {
return nil, errors.Join(err, errors.New("cannot create an operator client instance"))
Expand Down
4 changes: 2 additions & 2 deletions pkg/kubernetes/client/kubeclient_interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions pkg/kubernetes/client/mock_kube_client_connector.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ func (k *Kubernetes) InstallPerconaCatalog(ctx context.Context) error {
if err := k.client.ApplyFile(data); err != nil {
return errors.Join(err, errors.New("cannot apply percona catalog file"))
}
if err := k.client.DoPackageWait(ctx, "everest-operator"); err != nil {
if err := k.client.DoPackageWait(ctx, OLMNamespace, "everest-operator"); err != nil {
return errors.Join(err, errors.New("timeout waiting for package"))
}
return nil
Expand Down

0 comments on commit 0538005

Please sign in to comment.