-
Notifications
You must be signed in to change notification settings - Fork 49
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
✨ virtualmachinesetresourcepolicy: allow mutability of .spec.clusterModuleGroups #903
base: main
Are you sure you want to change the base?
Conversation
Nevermind, I am an idiot. |
@chrischdi I think you will need to also update the webhook's unit/integ tests. |
Thanks for the prompt responses, I hope this does not make too much noise to you folks. I had it around and thought it might be worth to not double the work / help you out :-) . I will take a look at the tests and the comments next week. |
I tried to address the findings :-) |
Please don't hestitate let me know if you currently have no time for this and want to follow up yourself on it. I'm also okay to help bring this over the finish line :-) |
690a4b1
to
ffdb04d
Compare
Minimum allowed line rate is |
} | ||
clusterRef, err := vcenter.GetResourcePoolOwnerMoRef(ctx, vimClient, rpMoID) | ||
if err != nil { | ||
errs = append(errs, err) |
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.
Depending on the error this could lead to deletion of cluster modules that are still actually in use, no?
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.
That's right, if
- there's an error getting the resource pool itself
- or the properties collector failed to get the owner property of the resource pool
The clusterRef may be missing.
I'll adjust to in that case don't reconcile cluster modules and return the error instead.
As alternative we could skip only deletion in reconcileClusterModules, but maybe not worth that complexity, what do you think?
} | ||
} | ||
|
||
type fakeClusterModule 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.
vcsim support for cluster modules is pretty good - and our testing frame makes it pretty easy to hook up vcsim - so I much prefer we use the actual impl
scheme := runtime.NewScheme() | ||
_ = vmopv1.AddToScheme(scheme) | ||
|
||
tests := []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.
For better or worse, we use Ginkgo and this is very go test. DescribeTable is the Ginkgo way to write tests like this
What does this PR do, and why is it needed?
.spec.clusterModuleGroups
.Which issue(s) is/are addressed by this PR? (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Are there any special notes for your reviewer:
I implemented some changes for CAPV and did take a quick look into this for vm-operator and seemed not to be too hard so I went ahead and implemented this feature.
Please add a release note if necessary: