Skip to content
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

api: support find.Network by cluster path #3045

Merged
merged 2 commits into from
Mar 2, 2023

Conversation

dougm
Copy link
Member

@dougm dougm commented Feb 8, 2023

Description

Datacenter's network folder may contain items with the same name.
For clusters that have one such instance of a given network name, the cluster inventory path will be unique.

Example:

% govc ls -l -t DistributedVirtualPortgroup /DC/host/compute-cluster
/DC/host/dev-cluster/vnet-domain-c9:f6555e6e-051f-4eec-9275-78ba7f689335-test-gc-e2e-demo-ns-91610-0 (DistributedVirtualPortgroup)
/DC/host/dev-cluster/seg-domain-c9:f6555e6e-051f-4eec-9275-78ba7f689335-test-gc-e2e-demo-ns-0 (DistributedVirtualPortgroup)
/DC/host/dev-cluster/vm-domain-c9:f6555e6e-051f-4eec-9275-78ba7f689335-vif-default-network-0 (DistributedVirtualPortgroup)
/DC/host/dev-cluster/containerswitchavi-1 (DistributedVirtualPortgroup)
/DC/host/dev-cluster/containerswitch-1 (DistributedVirtualPortgroup)
/DC/host/dev-cluster/dvpg-vmotion-1 (DistributedVirtualPortgroup)
/DC/host/dev-cluster/wcp_vds_1-DVUplinks-34 (DistributedVirtualPortgroup)

api: support find.NetworkList by ID

Rather than limit by ID search to find.Network, move the logic to NetworkList to support both methods.

Add finder_test (meant to include with PR #2626)

Type of change

Please mark options that are relevant:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update
  • Build related change

Datacenter's network folder may contain items with the same name.
For clusters that have one such instance of a given network name, the cluster inventory path will be unique.
Rather than limit by ID search to find.Network, move the logic to NetworkList to support both methods.

Add finder_test (meant to include with PR vmware#2626)
Copy link
Contributor

@tenthirtyam tenthirtyam left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@dougm dougm merged commit 813c2dc into vmware:main Mar 2, 2023
@dougm dougm deleted the cluster-network-list branch March 2, 2023 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants