Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1779313: Enable multiple namespaces sync if catsrc is updated in global ns #1125

Merged

Conversation

dinhxuanvu
Copy link
Member

Currently, if CatalogSource is updated and connection is Ready,
only the namespace where CatalogSource resides gets resynced. Now, a list
of namespaces that contain Subscriptions that use updated CatalogSource
will get resynced instead.

Signed-off-by: Vu Dinh vdinh@redhat.com

Description of the change:

Motivation for the change:

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 14, 2019
@dinhxuanvu
Copy link
Member Author

/retest

@awgreene
Copy link
Member

@dinhxuanvu
error: endpoint "https://registry.svc.ci.openshift.org" does not support v2 API

@dinhxuanvu
Copy link
Member Author

/retest

@njhale
Copy link
Member

njhale commented Nov 14, 2019

@dinhxuanvu could you open a BZ for this?

@dinhxuanvu
Copy link
Member Author

@njhale This PR is to address the issue on the existing bug that we were talking about during standup early on this week. I haven't tagged the bug on the title yet.

@dinhxuanvu
Copy link
Member Author

/retest

@dinhxuanvu dinhxuanvu changed the title Enable multiple namespaces sync if catsrc is updated in global ns Bug 1749031: Enable multiple namespaces sync if catsrc is updated in global ns Nov 15, 2019
@openshift-ci-robot
Copy link
Collaborator

@dinhxuanvu: This pull request references Bugzilla bug 1749031, which is valid. The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Bug 1749031: Enable multiple namespaces sync if catsrc is updated in global ns

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Nov 15, 2019
@dinhxuanvu
Copy link
Member Author

/retest

@njhale njhale changed the title Bug 1749031: Enable multiple namespaces sync if catsrc is updated in global ns Bug 1775323: Enable multiple namespaces sync if catsrc is updated in global ns Nov 21, 2019
@openshift-ci-robot
Copy link
Collaborator

@dinhxuanvu: This pull request references Bugzilla bug 1775323, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Bug 1775323: Enable multiple namespaces sync if catsrc is updated in global ns

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@njhale
Copy link
Member

njhale commented Nov 21, 2019

/bugzilla refresh

@openshift-ci-robot
Copy link
Collaborator

@njhale: This pull request references Bugzilla bug 1775323, which is valid.

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@dinhxuanvu dinhxuanvu force-pushed the sync-improve branch 4 times, most recently from 9d95057 to b42f7d7 Compare November 22, 2019 08:20
@dinhxuanvu
Copy link
Member Author

/retest

1 similar comment
@dinhxuanvu
Copy link
Member Author

/retest

pkg/lib/index/catalog.go Outdated Show resolved Hide resolved
pkg/controller/operators/catalog/operator.go Show resolved Hide resolved
@dinhxuanvu
Copy link
Member Author

/retest

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 2, 2019
@dinhxuanvu dinhxuanvu force-pushed the sync-improve branch 2 times, most recently from 5bb767a to 9be6708 Compare December 3, 2019 05:20
Signed-off-by: Vu Dinh <vdinh@redhat.com>
@dinhxuanvu
Copy link
Member Author

/retest

@jpeeler
Copy link

jpeeler commented Dec 3, 2019

/hold
I think a 4.4 bug needs to be made for this.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 3, 2019
@dinhxuanvu
Copy link
Member Author

/retest

@jpeeler jpeeler changed the title Bug 1775323: Enable multiple namespaces sync if catsrc is updated in global ns Bug 1779313: Enable multiple namespaces sync if catsrc is updated in global ns Dec 3, 2019
@openshift-ci-robot
Copy link
Collaborator

@dinhxuanvu: This pull request references Bugzilla bug 1779313, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Bug 1779313: Enable multiple namespaces sync if catsrc is updated in global ns

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jpeeler
Copy link

jpeeler commented Dec 3, 2019

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 3, 2019
@jpeeler
Copy link

jpeeler commented Dec 3, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 3, 2019
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dinhxuanvu, jpeeler

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 3, 2019
@openshift-merge-robot openshift-merge-robot merged commit 8d52709 into operator-framework:master Dec 3, 2019
@openshift-ci-robot
Copy link
Collaborator

@dinhxuanvu: All pull requests linked via external trackers have merged. Bugzilla bug 1779313 has been moved to the MODIFIED state.

In response to this:

Bug 1779313: Enable multiple namespaces sync if catsrc is updated in global ns

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Member

@njhale njhale left a comment

Choose a reason for hiding this comment

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

Looks like @jpeeler beat me to the punch!

I mostly had nits. I'm leaving them here in case you're interested @dinhxuanvu.

@@ -0,0 +1,53 @@
package indexer
Copy link
Member

Choose a reason for hiding this comment

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

nit: although there are some exceptions, this probably shouldn't be in the lib folder since it contains OLM specific logic.

}

if sub.Spec.CatalogSource != "" && sub.Spec.CatalogSourceNamespace != "" {
return []string{sub.Spec.CatalogSource + "/" + sub.Spec.CatalogSourceNamespace}, nil
Copy link
Member

Choose a reason for hiding this comment

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

nit: the common convention is namespace/name.


// CatalogSubscriberNamespaces returns the list of namespace (as a map with namespace as key)
// which has Suscriptions(s) that subscribe(s) to a given CatalogSource (name/namespace)
func CatalogSubscriberNamespaces(indexers map[string]cache.Indexer, name, namespace string) (map[string]struct{}, error) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: the result map isn't being used as a map outside of this function -- seems kinda leaky

// Locally it is `olm`
namespaces, _ := c.KubernetesInterface().CoreV1().Namespaces().List(metav1.ListOptions{})
for _, ns := range namespaces.Items {
if ns.GetName() == "openshift-marketplace" {
Copy link
Member

Choose a reason for hiding this comment

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

nit: it would be nice to take this as a test argument so we can avoid making configuration assumptions in our test logic.

CatalogSourceNamespace: globalNS,
Package: mainPackageName,
Channel: stableChannel,
StartingCSV: mainCSV.GetName(),
Copy link
Member

Choose a reason for hiding this comment

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

nit: no need to specify a StartingCSV or a manual approval strategy

Comment on lines +152 to +159
installPlanName := subscription.Status.Install.Name
requiresApprovalChecker := buildInstallPlanPhaseCheckFunc(v1alpha1.InstallPlanPhaseRequiresApproval)
fetchedInstallPlan, err := fetchInstallPlan(t, crc, installPlanName, requiresApprovalChecker)
require.NoError(t, err)

fetchedInstallPlan.Spec.Approved = true
_, err = crc.OperatorsV1alpha1().InstallPlans(testNamespace).Update(fetchedInstallPlan)
require.NoError(t, err)
Copy link
Member

Choose a reason for hiding this comment

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

Since you only put the manifests for the first CSV into the catalog, there's no need to step through updates using a manual approval strategy.

@dinhxuanvu
Copy link
Member Author

/cherry-pick release-4.3

@openshift-cherrypick-robot

@dinhxuanvu: new pull request created: #1166

In response to this:

/cherry-pick release-4.3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@dinhxuanvu
Copy link
Member Author

/cherry-pick release-4.2

@openshift-cherrypick-robot

@dinhxuanvu: failed to push cherry-picked changes in GitHub: pushing failed, output: "remote: Not Found\nfatal: repository 'https://openshift-cherrypick-robot:CENSORED@github.com/openshift-cherrypick-robot/operator-framework/operator-lifecycle-manager/' not found\n", error: exit status 128

In response to this:

/cherry-pick release-4.2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants