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

[WIP] Remove the code to change the Namespace to vim25 in NewClient function. #3405

Closed
wants to merge 1 commit into from

Conversation

lipingxue
Copy link
Contributor

Description

This change is to remove code to change the Namespace to vim25 in NewClient function. This is not needed and other client does not have this logic.
Closes: #(issue-number)

Type of change

Please mark options that are relevant:

  • [X ] 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

How Has This Been Tested?

Run the unit test for cns client, and it passed.

lipingx@lipingxNMD6R govmomi % pwd
/Users/lipingx/go/src/github.com/lipingxue/govmomi


lipingx@lipingxNMD6R cns %  go test -v
=== RUN   TestClient
    client_test.go:158: Creating volume using the spec: types.CnsVolumeCreateSpec{
            Name:       "pvc-901e87eb-c2bd-11e9-806f-005056a0c9a0",
            VolumeType: "BLOCK",
            Datastores: []types.ManagedObjectReference{
                {Type:"Datastore", Value:"datastore-48", ServerGUID:""},
            },
            Metadata: types.CnsVolumeMetadata{
                ContainerCluster: types.CnsContainerCluster{
                    ClusterType:         "KUBERNETES",
                    ClusterId:           "demo-cluster-id",
                    VSphereUser:         "Administrator@vsphere.local",
                    ClusterFlavor:       "VANILLA",
                    ClusterDistribution: "OpenShift",
                },
                EntityMetadata:        nil,
                ContainerClusterArray: nil,
            },
            BackingObjectDetails: &types.CnsBlockBackingDetails{
                CnsBackingObjectDetails: types.CnsBackingObjectDetails{
                    CapacityInMb: 5120,
                },
                BackingDiskId:                  "",
                BackingDiskUrlPath:             "",
                BackingDiskObjectId:            "",
                AggregatedSnapshotCapacityInMb: 0,
            },
            Profile:      nil,
            CreateSpec:   nil,
            VolumeSource: nil,
        }
    client_test.go:184: volumeCreateResult &{CnsVolumeOperationResult:{DynamicData:{} VolumeId:{DynamicData:{} Id:da92fb45-9308-43b7-84a4-2d5b44d2c0e0} Fault:<nil>} Name:pvc-901e87eb-c2bd-11e9-806f-005056a0c9a0 PlacementResults:[{Datastore:Datastore:datastore-48 PlacementFaults:[]}]}
    client_test.go:185: Volume created sucessfully. volumeId: da92fb45-9308-43b7-84a4-2d5b44d2c0e0

...

--- PASS: TestClient (23.62s)
PASS
ok  	github.com/vmware/govmomi/cns	23.927s

Checklist:

  • My code follows the CONTRIBUTION guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

@divyenpatel
Copy link
Member

we set version for vim client as below.
https://github.com/vmware/govmomi/blob/main/cns/client_test.go#L104C2-L104C29

	c.UseServiceVersion("vsan")
	cnsClient, err := NewClient(ctx, c.Client)

Can we remove c.UseServiceVersion("vsan") and execute tests against vCenter?

@lipingxue lipingxue changed the title Remove the code to change the Namespace to vim25 in NewClient function. [WIP] Remove the code to change the Namespace to vim25 in NewClient function. Apr 9, 2024
@lipingxue
Copy link
Contributor Author

This change is not needed. The issue has been addressed by this MR #3406

@lipingxue lipingxue closed this Apr 11, 2024
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.

None yet

3 participants