Skip to content

internal/olm: refactor package internal/operator and run packagemanifests logic#3764

Merged
estroz merged 4 commits intooperator-framework:masterfrom
estroz:refactor/run-olm
Aug 26, 2020
Merged

internal/olm: refactor package internal/operator and run packagemanifests logic#3764
estroz merged 4 commits intooperator-framework:masterfrom
estroz:refactor/run-olm

Conversation

@estroz
Copy link
Copy Markdown
Member

@estroz estroz commented Aug 20, 2020

Description of the change:

  • internal/olm: refactor package internal/operator into a coherent set of types under internal/olm/operator, and move the OLM installer into its own package

Motivation for the change: both run bundle and run packagemanifests share a lot of code, so should live under the same package such that types/functions can be shared as much as possible.

Closes #2938

/cc @rashmigottipati @jmrodri

Checklist

If the pull request includes user-facing changes, extra documentation is required:

@estroz estroz force-pushed the refactor/run-olm branch 4 times, most recently from d4b7e11 to e24c75b Compare August 20, 2020 08:33
}
}

func (c ConfigMapCatalogCreator) CreateCatalog(ctx context.Context, name string) (*v1alpha1.CatalogSource, error) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was refactored from internal/olm/operator/packagemanifests_manager.go.

Eric Stroczynski added 2 commits August 20, 2020 11:27
set of types under internal/olm/operator, and move the OLM installer
into its own package
@@ -0,0 +1,110 @@
// Copyright 2019 The Operator-SDK Authors
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was refactored from internal/olm/operator/olm.go.

// createOperatorGroup creates an OperatorGroup using package name if an OperatorGroup does not exist.
// If one exists in the desired namespace and it's target namespaces do not match the desired set,
// createOperatorGroup will return an error.
func (o OperatorInstaller) createOperatorGroup(ctx context.Context) error {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was moved here from internal/olm/operator/tenancy.go.

@estroz
Copy link
Copy Markdown
Member Author

estroz commented Aug 24, 2020

/cc @joelanford

Copy link
Copy Markdown
Member

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

The merge commit made it harder to review, but I was able to reconcile the commits from this PR and the ones from master.

I was able to trace the code from the run bundle all the way through into the OperatorInstaller. It makes sense. I didn't see anything that stood out. I was also able to trace through run packagemanifests as well.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 26, 2020
Copy link
Copy Markdown
Member

@rashmigottipati rashmigottipati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a few observations regarding BundleImage not being passed or set in IndexImageCatalogCreator, but that's not really the scope of this PR, so totally fine.

Everything looks great. Thanks a lot for your effort in refactoring this, as it eliminates additional duplicate code in the internal/operator package.

/lgtm

@estroz estroz merged commit a9d6b1b into operator-framework:master Aug 26, 2020
@estroz estroz deleted the refactor/run-olm branch August 26, 2020 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

operator-sdk run --olm reports installation failure after successful installation

4 participants