-
Notifications
You must be signed in to change notification settings - Fork 201
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
Support more configurations for GCPManagedMachinePool #1026
Support more configurations for GCPManagedMachinePool #1026
Conversation
|
Welcome @gzcharleszhang! |
Hi @gzcharleszhang. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
e997c3b
to
44bd891
Compare
f9cb96f
to
f866eb0
Compare
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.
/ok-to-test
3589b33
to
adf7f2b
Compare
Until #944 merges: /hold This is making changes to the same API kinds. @gzcharleszhang & @akshay196-rafay have you synced up? |
@richardcase I think I'll rebase after #944 merges. My PR will introduce a few more additional fields. |
Great, thanks @gzcharleszhang . I've approved #944, we just need another reviewer and someone to lgtm. |
@gzcharleszhang - now that #944 has merged would you be able to rebase and then we can aim to get this merged. |
adf7f2b
to
3ca0f69
Compare
93d7d5d
to
776d542
Compare
@richardcase I have rebased with the latest changes, could you help take a look? Thanks! |
776d542
to
03a2e20
Compare
cloud/scope/managedmachinepool.go
Outdated
// NodePoolResourceLabels returns the resource labels of the node pool. | ||
func NodePoolResourceLabels(additionalLabels infrav1.Labels, clusterName string) infrav1.Labels { | ||
resourceLabels := additionalLabels.DeepCopy() | ||
if resourceLabels == 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.
Should we check for nil before you do the deepcopy?
// setReadyStatusFromConditions updates the GCPManagedMachinePool's ready status based on its conditions. | ||
func (s *Service) setReadyStatusFromConditions() { | ||
machinePool := s.scope.GCPManagedMachinePool | ||
if conditions.IsTrue(machinePool, clusterv1.ReadyCondition) || conditions.IsTrue(machinePool, infrav1exp.GKEMachinePoolUpdatingCondition) { |
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.
Where we set the ready condition to true we can also set the Status.Ready
.
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 is what this helper function does, if the ready condition is true then we set the ready status to true
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 understand what the helper function is doing, my comment was more around not using this function and instead setting status ready at the same time you set the condition to true.
This function is defereed and also i'm not a fan on logic gitting off of conditions.
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 is more a personal/stylistic preference so lets not block on this.
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 see. The reason why I refactored it this way is because there were some places where we forgot to set the ready status when setting the ready condition. I thought this would make it more reliable so future contributors don't have to worry about setting both at the same time.
|
||
setNodePoolAutoscalingRequest := containerpb.SetNodePoolAutoscalingRequest{ | ||
Name: s.scope.NodePoolFullName(), | ||
} | ||
if !reflect.DeepEqual(desiredAutoscaling, existingAutoscaling) { | ||
if !reflect.DeepEqual(desiredAutoscaling, existingNodePool.Autoscaling) { |
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.
Can we change this to cmp.Equal
03a2e20
to
627fc41
Compare
GKE and machinepools are still experimental so: /override pull-cluster-api-provider-gcp-apidiff |
@richardcase: Overrode contexts on behalf of richardcase: pull-cluster-api-provider-gcp-apidiff 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. |
/lgtm |
Thanks for this @gzcharleszhang 👍 |
/unhold |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gzcharleszhang, richardcase 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Currently, GCPManagedMachinePool only supports a limited set of configurations. This PR adds support for a wider set of configurations made available by the GCP SDK. Specifically, it adds support for the following fields:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #1025
Special notes for your reviewer:
Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.
TODOs:
Release note: