Skip to content

add OperatorGroup reconciliation #2517

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

Closed

Conversation

akihikokuroda
Copy link
Member

Signed-off-by: akihikokuroda [email protected]

Description of the change:
Add OperatorGroup reconciliation in Catalog operator so that the operator group creation can trigger InstallPlan sync.

Motivation for the change:
Closes #2516
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 /doc
  • Commit messages sensible and descriptive

@openshift-ci openshift-ci bot requested review from benluddy and ecordell December 10, 2021 17:48
@openshift-ci
Copy link

openshift-ci bot commented Dec 10, 2021

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: akihikokuroda
To complete the pull request process, please assign kevinrizza after the PR has been reviewed.
You can assign the PR to them by writing /assign @kevinrizza in a comment when ready.

The full list of commands accepted by this bot can be found 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 openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 10, 2021
@openshift-ci
Copy link

openshift-ci bot commented Dec 10, 2021

Hi @akihikokuroda. Thanks for your PR.

I'm waiting for a operator-framework member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@akihikokuroda akihikokuroda force-pushed the ogsync branch 3 times, most recently from 048f8b0 to 5cce51b Compare December 12, 2021 19:05
@timflannagan timflannagan removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 12, 2021
@perdasilva
Copy link
Collaborator

Hey @akihikokuroda thanks for this! Would it be possible to add unit tests at all?

@akihikokuroda
Copy link
Member Author

@perdasilva Thanks for comment. I'll look into what unit test needs for this change.

@akihikokuroda akihikokuroda force-pushed the ogsync branch 2 times, most recently from a4dfccb to 4819199 Compare December 14, 2021 17:46
@akihikokuroda
Copy link
Member Author

I added a small unit test for operatorgroup sync.

return o.triggerInstallPlanRetry(obj)
}

func (o *Operator) syncOperatorGroup(obj interface{}) (syncError error) {
// Assert as metav1.Object
Copy link
Member

Choose a reason for hiding this comment

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

Nit - I don't think this comment adds any value.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! I'll take it out.

out := ip.DeepCopy()
out.Status.Phase = v1alpha1.InstallPlanPhaseInstalling
now := o.now()
out.Status.SetCondition(v1alpha1.ConditionFailed(v1alpha1.InstallPlanInstalled, v1alpha1.InstallPlanReasonComponentFailed, "OperatorGroup updated", &now))
Copy link
Member

Choose a reason for hiding this comment

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

Is this the right condition to add? If we are re-triggering the installPlan I don't think a component failed anymore.

Copy link
Member Author

@akihikokuroda akihikokuroda Jan 15, 2022

Choose a reason for hiding this comment

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

I see. That's right. I'll change to ConditionMet. Thanks!

@akihikokuroda
Copy link
Member Author

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 18, 2022
@akihikokuroda
Copy link
Member Author

I saw this panic. It's probably unrelated the changes in this PR so far but I add some code to prevent this in this PR. This panic causes the same e2e failure.

2022-01-18T18:23:06.480373869Z stderr F time="2022-01-18T18:23:06Z" level=debug msg="Got source event: grpc.SourceState{Key:registry.CatalogKey{Name:\"mock-ocs-main-m48zw\", Namespace:\"operator-lifecycle-manager\"}, State:2}"
2022-01-18T18:23:06.480396869Z stderr F time="2022-01-18T18:23:06Z" level=info msg="state.Key.Namespace=operator-lifecycle-manager state.Key.Name=mock-ocs-main-m48zw state.State=READY"
2022-01-18T18:23:06.490549584Z stderr F time="2022-01-18T18:23:06Z" level=error msg="error updating InstallPlan status" id=ilvfL ip=ip namespace=ns-d8pd9 phase=Installing updateError="Operation cannot be fulfilled on installplans.operators.coreos.com \"ip\": the object h\
as been modified; please apply your changes to the latest version and try again"
2022-01-18T18:23:06.495193536Z stderr F panic: runtime error: invalid memory address or nil pointer dereference
2022-01-18T18:23:06.495203736Z stderr F [signal SIGSEGV: segmentation violation code=0x1 addr=0xf4 pc=0x942671d]
2022-01-18T18:23:06.495206836Z stderr F
2022-01-18T18:23:06.495211136Z stderr F goroutine 433 [running]:
2022-01-18T18:23:06.495315737Z stderr F github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/catalog.(*Operator).syncInstallPlans(0xbeae410, {0x98647e0, 0xc412120})
2022-01-18T18:23:06.495387838Z stderr F         /home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/pkg/controller/operators/catalog/operator.go:1593 +0x9ed
2022-01-18T18:23:06.495486339Z stderr F github.com/operator-framework/operator-lifecycle-manager/pkg/lib/queueinformer.LegacySyncHandler.ToSyncerWithDelete.func1({0x9b5e758, 0xbc7a150}, {0x9b55b6c, 0xbfdb240})
2022-01-18T18:23:06.495491739Z stderr F         /home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/pkg/lib/queueinformer/queueinformer.go:181 +0xed
2022-01-18T18:23:06.495630841Z stderr F github.com/operator-framework/operator-lifecycle-manager/pkg/lib/kubestate.SyncFunc.Sync(0xbc9e7f0, {0x9b5e758, 0xbc7a150}, {0x9b55b6c, 0xbfdb240})
2022-01-18T18:23:06.495714042Z stderr F         /home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/pkg/lib/kubestate/kubestate.go:184 +0x3c
2022-01-18T18:23:06.495779942Z stderr F github.com/operator-framework/operator-lifecycle-manager/pkg/lib/queueinformer.(*QueueInformer).Sync(...)
2022-01-18T18:23:06.495784942Z stderr F         /home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/pkg/lib/queueinformer/queueinformer.go:35
2022-01-18T18:23:06.495876443Z stderr F github.com/operator-framework/operator-lifecycle-manager/pkg/lib/queueinformer.(*operator).processNextWorkItem(0xbe6ad90, {0x9b5e758, 0xbc7a150}, 0xbca79e0)
2022-01-18T18:23:06.495919944Z stderr F         /home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/pkg/lib/queueinformer/queueinformer_operator.go:287 +0x887
2022-01-18T18:23:06.496032045Z stderr F github.com/operator-framework/operator-lifecycle-manager/pkg/lib/queueinformer.(*operator).worker(0xbe6ad90, {0x9b5e758, 0xbc7a150}, 0xbca79e0)
2022-01-18T18:23:06.496135646Z stderr F         /home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/pkg/lib/queueinformer/queueinformer_operator.go:231 +0x39
2022-01-18T18:23:06.496140746Z stderr F created by github.com/operator-framework/operator-lifecycle-manager/pkg/lib/queueinformer.(*operator).start
2022-01-18T18:23:06.496233648Z stderr F         /home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/pkg/lib/queueinformer/queueinformer_operator.go:221 +0x560

@akihikokuroda akihikokuroda force-pushed the ogsync branch 2 times, most recently from 0409a45 to 00be3ce Compare January 18, 2022 21:31
@akihikokuroda
Copy link
Member Author

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 18, 2022
@akihikokuroda akihikokuroda force-pushed the ogsync branch 2 times, most recently from b6213fa to 7d7f77d Compare January 28, 2022 18:25
@akihikokuroda akihikokuroda force-pushed the ogsync branch 2 times, most recently from e25638f to ef0bfd8 Compare February 4, 2022 22:31
@akihikokuroda akihikokuroda force-pushed the ogsync branch 2 times, most recently from b050ace to e13258f Compare February 20, 2022 15:47
@akihikokuroda
Copy link
Member Author

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 21, 2022
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 21, 2023
@openshift-merge-robot
Copy link
Collaborator

PR needs rebase.

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.

@perdasilva
Copy link
Collaborator

@akihikokuroda could you please resolve conflicts?

@perdasilva
Copy link
Collaborator

closing PR as stale. Please re-open if it's still important.

@perdasilva perdasilva closed this Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. runtime
Projects
None yet
5 participants