-
Notifications
You must be signed in to change notification settings - Fork 286
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
Refactoring cluster manager to invoke provider's SpecChanged method #1808
Refactoring cluster manager to invoke provider's SpecChanged method #1808
Conversation
Skipping CI for Draft Pull Request. |
logger.V(3).Info(fmt.Sprintf("Old machine config spec %s not found in the existing spec", oldMcRef.Name)) | ||
return true, nil | ||
} | ||
if !reflect.DeepEqual(existingVmc.Spec, csmc.Spec) { |
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 recognize that using reflect is non-ideal, but this is what the cluster manager was using previously and to keep the changes smaller and minimize blast radius, I'd like to continue using it for now. The vsphere machine config spec's Equal method is not implemented. Defining that Equal method may require some VSphere context which I don't feel fully equipped to do
/override eks-anywhere-release-tooling-test-presubmit |
@abhay-krishna: Overrode contexts on behalf of abhay-krishna: eks-anywhere-release-tooling-test-presubmit 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. |
@maxdrib: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
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.
Looks good! just one suggestion that I think would make it a bit cleaner
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.
Looks good, just minor comments
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.
/lgtm
@@ -199,6 +200,32 @@ func (p *vsphereProvider) UpdateKubeConfig(_ *[]byte, _ string) error { | |||
return nil | |||
} | |||
|
|||
func (p *vsphereProvider) machineConfigsSpecChanged(ctx context.Context, cc *v1alpha1.Cluster, cluster *types.Cluster, newClusterSpec *cluster.Spec) (bool, error) { | |||
machineConfigMap := make(map[string]*v1alpha1.VSphereMachineConfig) | |||
for _, config := range p.MachineConfigs(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.
We need to clean this up, either remove the parameter from the function or actually use it instead of referencing the values from the struct.
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.
The parameter is currently being used in the snow provider, but nowhere else I believe. Is this the model all the providers should adopt? It may be worth creating an issue about 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.
Since this is not an exported method, we have control on what parameters to pass in based on the provider right?
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: g-gaston 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 |
Issue #, if available: #1669
Description of changes:
This PR removes the cloudstack-specific logic (in a backwards compatible way) from the cluster-manager and moves it to the provider for both CloudStack and VSphere
Testing (if applicable):
Unit tests pass
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.