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 1740332: OLM should resume operator install #1006

Merged
merged 1 commit into from
Aug 26, 2019

Conversation

tkashem
Copy link
Collaborator

@tkashem tkashem commented Aug 22, 2019

OLM should automatically resume operator install when a user grants
proper permission(s).

Currently, a user has to manually delete the subscription and recreate
it in order to trigger a reinstall of the operator.

Do the following to trigger reinstall:

  • Add a new field 'AttenuatedServiceAccountRef' to status of
    InstallPlan. We use this to refer to the ServiceAccount that will be
    used to do attenuated scoped install of the operator.
  • Watch on Role(Binding), ServiceAccount resources. When these RBAC
    resources are added/updated find the target InstallPlan object.
  • Update the status.phase of the InstallPlan object to Installing.
    This will trigger a sync of the InstallPlan.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1740332
Jira: https://jira.coreos.com/browse/OLM-1244

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 22, 2019
@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 22, 2019
@tkashem
Copy link
Collaborator Author

tkashem commented Aug 22, 2019

/test e2e-aws-console-olm

@jpeeler
Copy link

jpeeler commented Aug 22, 2019

I don't think approach will work (well) since syncObject will constantly attempt reinstalling without any change in the cluster edit: sorry, missed the kind switch. Since install plans aren't reconciled constantly by design, I'm thinking the best way to proceed is to watch newly created roles and see if they apply to existing install plans (or perhaps check the status of failed install plans?)

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 23, 2019
@tkashem tkashem changed the title [WIP] test - olm should resume operator install Bug 1740332: OLM should resume operator install Aug 23, 2019
@openshift-ci-robot openshift-ci-robot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Aug 23, 2019
@openshift-ci-robot
Copy link
Collaborator

@tkashem: This pull request references Bugzilla bug 1740332, 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 1740332: OLM should resume operator install

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.

@tkashem
Copy link
Collaborator Author

tkashem commented Aug 26, 2019

/retest

Copy link
Member

@ecordell ecordell left a comment

Choose a reason for hiding this comment

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

/lgtm

had a couple of nits but I don't think they should block

return
}

func (s *ClientAttenuator) AttenuateClientWithServiceAccount(reference *corev1.ObjectReference) (kubeclient operatorclient.ClientInterface, crclient versioned.Interface, err 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 comment has a different name than the method

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -1075,6 +1097,8 @@ var _ installPlanTransitioner = &Operator{}
func transitionInstallPlanState(log *logrus.Logger, transitioner installPlanTransitioner, in v1alpha1.InstallPlan, now metav1.Time) (*v1alpha1.InstallPlan, error) {
out := in.DeepCopy()


Copy link
Member

Choose a reason for hiding this comment

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

nit: extra spaces

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

return
}

logger.Infof("successfully attached attenuated ServiceAccount to status - %s", reference.Name)
Copy link
Member

Choose a reason for hiding this comment

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

nit: could use a structured logging field for the reference.Name here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done


if updateErr := update(ip); updateErr != nil {
errs = append(errs, updateErr)
logger.Warnf("failed to kick off InstallPlan retry - %v", updateErr)
Copy link
Member

Choose a reason for hiding this comment

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

nit logger.WithError()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 26, 2019
OLM should automatically resume operator install when a user grants
proper permission(s).

Currently, a user has to manually delete the subscription and recreate
it in order to trigger a reinstall of the operator.

Do the following to trigger reinstall:
- Add a new field 'AttenuatedServiceAccountRef' to status of
  InstallPlan. We use this to refer to the ServiceAccount that will be
  used to do attenuated scoped install of the operator.
- Watch on Role(Binding), ServiceAccount resources. When these RBAC
  resources are added/updated find the target InstallPlan object.
- Update the status.phase of the InstallPlan object to Installing.
  This will trigger a sync of the InstallPlan.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1740332
Jira: https://jira.coreos.com/browse/OLM-1244
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Aug 26, 2019
@tkashem
Copy link
Collaborator Author

tkashem commented Aug 26, 2019

/retest

@jpeeler
Copy link

jpeeler commented Aug 26, 2019

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ecordell, jpeeler, tkashem

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-merge-robot openshift-merge-robot merged commit 3fe25c4 into operator-framework:master Aug 26, 2019
@openshift-ci-robot
Copy link
Collaborator

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

In response to this:

Bug 1740332: OLM should resume operator install

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.

5 participants