-
Notifications
You must be signed in to change notification settings - Fork 82
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
OCM-2641, OCM-17: Specify worker disk size for machine pools #244
OCM-2641, OCM-17: Specify worker disk size for machine pools #244
Conversation
@JohnStrunk: This pull request references OCM-17 which is a valid jira issue. In response to this:
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. |
Skipping CI for Draft Pull Request. |
cdff057
to
0907376
Compare
@JohnStrunk: This pull request references OCM-17 which is a valid jira issue. In response to this: 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. |
1 similar comment
@JohnStrunk: This pull request references OCM-17 which is a valid jira issue. In response to this: 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. |
/hold |
@bardielle This is ready for a first look, though I want to do some more testing once the above bug is resolved. |
@JohnStrunk: This pull request references OCM-17 which is a valid jira issue. In response to this:
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. |
Optional: true, | ||
Computed: true, | ||
PlanModifiers: []tfsdk.AttributePlanModifier{ | ||
tfsdk.UseStateForUnknown(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can add a validation here on the disk size value
0907376
to
5a8a32b
Compare
/unhold |
/retest |
3 similar comments
/retest |
/retest |
/retest |
/retest |
@@ -15,22 +15,22 @@ var _ = Describe("Cluster", func() { | |||
}) | |||
Context("CreateNodes validation", func() { | |||
It("Autoscaling disabled minReplicas set - failure", func() { | |||
err := cluster.CreateNodes(false, nil, pointer(int64(2)), nil, nil, nil, nil, false) | |||
err := cluster.CreateNodes(false, nil, pointer(int64(2)), nil, nil, nil, nil, false, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add one test with non empty diskSize value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
if workerDiskSize != nil { | ||
nodes.ComputeRootVolume( | ||
cmv1.NewRootVolume().AWS( | ||
cmv1.NewAWSVolume().Size(int(*workerDiskSize)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to set default value here or just use the default value in the OCM backend?
What is the behavior in the CLI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the CLI, if the size is not set or identical to the flavor's default size, we do nothing and let the backend handle the defaults.
provider/machine_pool_resource.go
Outdated
@@ -184,6 +184,16 @@ func (t *MachinePoolResourceType) GetSchema(ctx context.Context) (result tfsdk.S | |||
ValueCannotBeChangedModifier(), | |||
}, | |||
}, | |||
"disk_size": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please generate the attributes in the documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regenerate it please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
0c54fc2
to
7636768
Compare
/hold Will be merged only after v1.3.0 release |
/hold |
7636768
to
e05aa9f
Compare
CI failure during cluster destroy:
Seems to be an AWS permission problem. |
/retest |
Adds `worker_disk_size` to cluster resource. This is used only at cluster creation to determine the size of the default MP's disk size Signed-off-by: John Strunk <[email protected]>
Signed-off-by: John Strunk <[email protected]>
e05aa9f
to
1f84947
Compare
@@ -252,6 +252,10 @@ func (r *ClusterRosaClassicResource) Schema(ctx context.Context, req resource.Sc | |||
stringplanmodifier.RequiresReplace(), | |||
}, | |||
}, | |||
"worker_disk_size": schema.Int64Attribute{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should throw an error if the user tries to update it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can add a plan modifier that prevents this value being changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This option needs to be treated identically to what's being done in #228 since this setting is configuring the default MP.
Since the framework upgrade, we have removed all of the ValueCannotBeChanged
checks. Should I look into re-introducing that?
And, what about #228-- should that be changed as well?
If so, I'd prefer to move these checks to another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should also be changed in #228
I had 2 comments but overall it looks good |
Signed-off-by: John Strunk <[email protected]>
/retest |
/lgtm |
/unhold |
/retest |
Looks like CI troubles again:
|
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sagidayan 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 |
worker_disk_size
to cluster resource. This is used only at cluster creation to determine the size of the default MP's disk sizedisk_size
to the machinepool resource. -- Only used at pool creation timeSupersceedes #100