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

Handling populate relavant values in machine pool #317

Merged
merged 1 commit into from
Oct 1, 2023

Conversation

tsorya
Copy link
Contributor

@tsorya tsorya commented Sep 27, 2023

No description provided.

@sagidayan
Copy link
Contributor

I think this is not the behavior we want. I'll take this offline 😉 .

/hold

@sagidayan
Copy link
Contributor

This looks better 💪🏽 . Lets see CI

@@ -544,14 +544,9 @@ func (r *MachinePoolResource) Update(ctx context.Context, req resource.UpdateReq

object := update.Body()

// update the autoscaling enabled with the plan value (important for nil and false cases)
state.AutoScalingEnabled = plan.AutoScalingEnabled
Copy link
Member

Choose a reason for hiding this comment

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

While AutoScalingEnabled can be not computed, I think Replicas need to be computed because when user doesn't declare value we put default =2
Anyway this should be done in populate and not here.

@JohnStrunk @bardielle @sagidayan what do you think?

I hope we will have here one convention how those cases should be handled

Comment on lines +548 to +549
r.populateState(object, plan)
diags = resp.State.Set(ctx, plan)
Copy link
Member

Choose a reason for hiding this comment

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

Good catch.

I think its a bit confusing that in some places we assign the Plan into parameter called state.
(for example in Create and populate functions)
We should refactor the code to make it more consistent and clear

@nirarg
Copy link
Member

nirarg commented Oct 1, 2023

/approve
/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Oct 1, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nirarg

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 openshift-ci bot added the approved label Oct 1, 2023
@nirarg
Copy link
Member

nirarg commented Oct 1, 2023

/retest

@openshift-merge-robot openshift-merge-robot merged commit 5cc5619 into terraform-redhat:main Oct 1, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants