Skip to content

vcsim: remove simulator.Map package variable#3701

Merged
dougm merged 1 commit intovmware:mainfrom
dougm:vcsim-context
Mar 4, 2025
Merged

vcsim: remove simulator.Map package variable#3701
dougm merged 1 commit intovmware:mainfrom
dougm:vcsim-context

Conversation

@dougm
Copy link
Copy Markdown
Member

@dougm dougm commented Mar 3, 2025

This package var has prevented multiple instances of vcsim running in parallel the same process.
Each simulator Model/Service instance now has its own Registry (Map) instance and Context.
The simulator.{Test,Run} functions are now passed the simulator.Context instance as the
context.Context callback param. 'simulator.Map' is now a helper function / shortcut to
reference the Map field of the Context instance.

BREAKING: simulator.Map package variable has been removed

BREAKING: simulator.SpoofContext function has been renamed to NewContext

dougm added a commit to dougm/vm-operator that referenced this pull request Mar 3, 2025
@dougm
Copy link
Copy Markdown
Member Author

dougm commented Mar 3, 2025

vm-operator update against this branch: vmware-tanzu/vm-operator@main...dougm:vcsim-refactor

This package var has prevented multiple instances of vcsim running in parallel the same process.
Each simulator Model/Service instance now has its own Registry (Map) instance and Context.
The simulator.{Test,Run} functions are now passed the simulator.Context instance as the
context.Context callback param. 'simulator.Map' is now a helper function / shortcut to
reference the Map field of the Context instance.

BREAKING: simulator.Map package variable has been removed

BREAKING: simulator.SpoofContext function has been renamed to NewContext

Signed-off-by: Doug MacEachern <dougm@broadcom.com>
Copy link
Copy Markdown
Member

@dilyar85 dilyar85 left a comment

Choose a reason for hiding this comment

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

LGTM! I didn't review every line due to the size of the change, but I did some sanity checks and confirmed there's no usage of the simulator.Map package var. Thanks @dougm!

@dougm dougm merged commit a640504 into vmware:main Mar 4, 2025
12 checks passed
@dougm dougm deleted the vcsim-context branch March 4, 2025 19:08
dougm added a commit to dougm/vm-operator that referenced this pull request Mar 4, 2025
dougm added a commit to dougm/vm-operator that referenced this pull request Mar 4, 2025
dougm added a commit to dougm/vsphere-csi-driver that referenced this pull request Mar 6, 2025
The simulator.Map package variable has been removed from govmomi.
See: vmware/govmomi#3701

The simulator.Map usage had been read-only, so changed to use vim25.Client instead.
These tests don't have access to simulator instance Context, so we can't use the
in-memory 'model.Map()' as pkg/common/cns-lib/vsphere/virtualmachine_test.go does.
dougm added a commit to dougm/vsphere-csi-driver that referenced this pull request Mar 11, 2025
The simulator.Map package variable has been removed from govmomi.
See: vmware/govmomi#3701

The simulator.Map usage had been read-only, so changed to use vim25.Client instead.
These tests don't have access to simulator instance Context, so we can't use the
in-memory 'model.Map()' as pkg/common/cns-lib/vsphere/virtualmachine_test.go does.
dougm added a commit to dougm/cloud-provider-vsphere that referenced this pull request Mar 11, 2025
The simulator.Map package variable has been removed from govmomi.

See: vmware/govmomi#3701
@vmware vmware locked as resolved and limited conversation to collaborators Mar 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants