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

Add installPlanApproval to Subscription-v1 #348

Merged

Conversation

ecordell
Copy link
Member

@ecordell ecordell commented May 9, 2018

The installPlanApproval field on Subscription will dictate the approval field of the InstallPlans that get created by the Subscription.

Also removed the Upgrade-Only enum option, until we decide that it's valuable and implement it.


// GetInstallPlanApproval gets the configured install plan approval or the default
func (s *Subscription) GetInstallPlanApproval() v1alpha1.Approval {
if s.Spec.InstallPlanApproval == v1alpha1.ApprovalManual {
Copy link
Member

Choose a reason for hiding this comment

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

I know this works now because there are only 2 possible values, but it should really be:

if s.Spec.InstallPlanApproval == nil {
        return v1alpha1.ApprovalAutomatic
}
return s.Spec.InstallPlanApproval

Copy link
Member Author

Choose a reason for hiding this comment

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

I did it this way so that any invalid approvals (approval: foo etc) will get defaulted to Automatic. If we ever get to more than two approval types I would change this to set logic (if approval not in set_of_allowed_values, return default)

@ecordell ecordell force-pushed the subscription-approvalmode branch 6 times, most recently from 965605e to 455f15c Compare May 10, 2018 19:20
Setting installPlanApproval on the subscription directs OLM to create
installPlans with the specified approval mode (Automatic or Manual)
@ecordell ecordell force-pushed the subscription-approvalmode branch 3 times, most recently from ada40fb to 62b2ef4 Compare May 10, 2018 21:29
@ecordell ecordell force-pushed the subscription-approvalmode branch from 62b2ef4 to 51fd078 Compare May 10, 2018 22:01
alecmerdler
alecmerdler previously approved these changes May 11, 2018
Copy link
Member

@alecmerdler alecmerdler left a comment

Choose a reason for hiding this comment

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

LGTM, can't wait to add this to the UI!

@ecordell ecordell force-pushed the subscription-approvalmode branch 6 times, most recently from 83616a7 to fea0ca3 Compare May 11, 2018 23:51
@ecordell ecordell force-pushed the subscription-approvalmode branch from fea0ca3 to 0105bac Compare May 11, 2018 23:55
Copy link
Member

@alecmerdler alecmerdler left a comment

Choose a reason for hiding this comment

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

Still LGTM, can't wait to add this to the UI!

@ecordell ecordell merged commit ffdab71 into operator-framework:master May 12, 2018
@ecordell ecordell deleted the subscription-approvalmode branch May 15, 2018 21:58
njhale pushed a commit to njhale/operator-lifecycle-manager that referenced this pull request Sep 10, 2018
…approvalmode

Add installPlanApproval to Subscription-v1
ecordell added a commit to ecordell/operator-lifecycle-manager that referenced this pull request Mar 8, 2019
…approvalmode

Add installPlanApproval to Subscription-v1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants