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

controllers: replicate odf tolerations to child subscriptions #368

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

iamniting
Copy link
Member

Signed-off-by: Nitin Goyal [email protected]

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 5, 2024
@iamniting
Copy link
Member Author

/test odf-operator-e2e-aws

Comment on lines +50 to +52
if odfSub.Spec.Config == nil {
odfSub.Spec.Config = &operatorv1alpha1.SubscriptionConfig{}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not needed. Do not update your own subscription.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is not gonna update. It is just to save from the panic in the below code.

if actualSub != nil {
foundSubs := []string{actualSub.Name, sub.Name}
return nil, fmt.Errorf("multiple Subscriptions found for package '%s': %v", pkgName, foundSubs)
}
actualSub = &subsList.Items[i]
actualSub.Spec.Channel = desiredSubscription.Spec.Channel

// If the config is not set, only then set it to the desired value => allow user to override
if actualSub.Spec.Config == nil {
if actualSub.Spec.Config == nil && desiredSubscription.Spec.Config == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just update

func GetStorageClusterSubscriptions() []*operatorv1alpha1.Subscription {
to inject tolerations instead of all these checks?

Add tolerations to desired subscription, and during reconcile merge actual and desired subs. Wouldn't that be simpler?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually that will require extensive changes in the code, we will have to change the signature of multiple funcs.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 15, 2024
Copy link
Contributor

openshift-ci bot commented Feb 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: iamniting, umangachapagain

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

@iamniting
Copy link
Member Author

/test odf-operator-e2e-aws

1 similar comment
@iamniting
Copy link
Member Author

/test odf-operator-e2e-aws

@openshift-merge-bot openshift-merge-bot bot merged commit 9a4efc9 into red-hat-storage:main Feb 15, 2024
16 checks passed
@iamniting iamniting deleted the tolerations branch May 17, 2024 10:27
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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants