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

Sync Fork #2

Open
wants to merge 264 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
264 commits
Select commit Hold shift + click to select a range
20d75cd
Utility scripts (#391)
dataclouder Aug 3, 2021
a7edcad
Update vdc storage profiles (#393)
dataclouder Aug 6, 2021
01b2289
go fmt with Go 1.17 (#396)
Didainius Sep 2, 2021
f6b67cc
Add OwnerRef field to types.OpenAPIEdgeGateway (#397)
lelvisl Sep 2, 2021
dd8f46a
Add NSX-T ALB provider configuration support (#398)
Didainius Sep 14, 2021
98d8594
Add support External Network backed NSX-T Segment (#399)
Didainius Sep 30, 2021
58237d3
Add CHANGELOG for 2.13.0 (#400)
dataclouder Sep 30, 2021
ae75935
Fix PR reference in changelog (#401)
Didainius Sep 30, 2021
79873f4
Fix receiver name in client and comments (#379)
crashiura Oct 6, 2021
a9cf9f3
Fix client name that was broken in PR #379 (#402)
dataclouder Oct 8, 2021
693e518
Add support for NSX-T Alb General Settings in NSX-T Edge Gateway (#403)
Didainius Nov 4, 2021
1f49627
Add support for Certificate management in Administration/Certificate …
vbauzys Nov 9, 2021
658554e
Introduce Api tokens support (#406)
dataclouder Nov 19, 2021
170309a
Add support for ALB Service Engine Group assignment to Edge Gateway (…
Didainius Nov 19, 2021
a07f243
Fix coverity warnings (#408)
dataclouder Nov 24, 2021
e6cba8c
Add session info to govcd logs (#409)
dataclouder Nov 26, 2021
431b19e
Fix broken logging (#412)
Didainius Dec 13, 2021
fdbe48c
Change refresh_token to use request body (#415)
dataclouder Dec 13, 2021
56572c4
Add support for managing VDC group (#410)
vbauzys Dec 20, 2021
3cccf38
Add support for NSX-T ALB Pools (#414)
Didainius Dec 20, 2021
a0ec712
Fix issue when internal disk update would clean VM description (#418)
vbauzys Dec 20, 2021
e27dc7f
Introduce ALB Virtual Service management functions (#417)
Didainius Dec 21, 2021
f457d1a
bugfix: Do not send Weight in ChangeCPUCountWithCore (#419)
Didainius Jan 4, 2022
640a551
Add vApp lease handling (#420)
dataclouder Jan 4, 2022
9d20e5d
Add changelog for v2.14.0 (#423)
Didainius Jan 7, 2022
962a939
Add upload OVF by URL and vApp template update methods (#422)
vbauzys Jan 17, 2022
25528f5
Add methods to publish catalogs to external VCD Orgs (#424)
vbauzys Jan 17, 2022
3a0f59d
fix catalog cleanup in tests (#426)
vbauzys Jan 18, 2022
c3b8ae8
Rename master branch to main (#427)
vbauzys Jan 19, 2022
e5ad3e7
Add disk sharing functionality (v35.0) and UUID (v36.0) (#383)
arunmk Feb 18, 2022
7df33b7
Fix GetStorageProfileByHref method (#435)
vbauzys Feb 21, 2022
d0450d3
Vdc bug fixes for disabling storage profile and deserializing type.Ta…
vbauzys Feb 21, 2022
b7b37ed
Add new VM cpu and memory functions (#432)
vbauzys Feb 21, 2022
be6421a
Independent disk new properties support added which are supported fro…
vbauzys Feb 22, 2022
334557f
Add AdminCatalog metadata methods (#430)
Feb 23, 2022
d7ca47c
Api bump from v33.0 to v35.0 (#434)
Mar 2, 2022
e6f697c
Catalog.QueryMediaList bugfix (#441)
Mar 3, 2022
179b246
Add metadata functions for organizations and independent disks (#438)
adambarreiro Mar 7, 2022
7827b70
Add UsersList attribute to Group and add IsExternal attribute logic t…
adambarreiro Mar 7, 2022
6f9b443
Publish to external VCD ORG and subscribe attributes on OrgGeneralSet…
Mar 15, 2022
7494bee
Fix bug Test_VdcUpdateStorageProfile test. Bool was being compared ag…
Mar 17, 2022
3cf7a8f
Add VDC Group support for NSX-T Edge Gateways (#440)
Didainius Mar 21, 2022
24fc146
Fix group.Update() when users list is populated (#449)
adambarreiro Mar 21, 2022
5ad8d90
Solve bug that prevented sending StoredVmQuota and DeployedVmQuota wh…
Mar 22, 2022
e9de703
Add Org VDC network support for NSX-T VDC Groups (#443)
Didainius Mar 24, 2022
169985e
Add metadata support for VDC networks (#442)
adambarreiro Mar 24, 2022
c80fab6
Add method AdminOrg.FindCatalogRecords (#450)
Mar 25, 2022
f7c5c53
Add new wrappers functions for IP Set using VDC Groups (#451)
vbauzys Mar 31, 2022
877dfc8
Bump staticcheck to 2022.1 with Go 1.18 support (#457)
Didainius Apr 4, 2022
2603ba8
Add metadata CRUD functions for OpenApiOrgVdcNetwork (#459)
adambarreiro Apr 5, 2022
f78abc0
Catalog and LDAP tests fix (#458)
Apr 6, 2022
f9e31a0
Add new wrappers functions for Org Networks using VDC Groups (#456)
vbauzys Apr 6, 2022
cdf3ebc
Add Vdc.GetNsxtAppPortProfileByName and VdcGroup.GetNsxtAppPortProfil…
Didainius Apr 6, 2022
d3a0c52
Add generic CRUD metadata by href functions (#454)
adambarreiro Apr 6, 2022
eb47cae
Add support for Distributed Firewall and Network Context Profile look…
Didainius Apr 7, 2022
25ae223
Release 2.15.0 with CHANGELOG (#463)
Didainius Apr 14, 2022
d74d4e0
Prepare 2.16 release cycle (#464)
Didainius Apr 20, 2022
2914d58
Fix catalog query (#466)
vbauzys Apr 28, 2022
011d36c
Add DNS option to the NSX-T Segment DHCP server (#465)
Apr 29, 2022
2c1c04a
Change owner to VdcComputePolicy functions (#468)
dataclouder May 5, 2022
d905678
Add security tags capabilities to govcd (#467)
May 10, 2022
e1ba152
Add CRUD metadata functions to CatalogItem (#471)
adambarreiro May 17, 2022
3a25b6b
Add more convenience methods for Org Vdc network DHCP handling (#469)
Didainius May 23, 2022
7ea8e53
Improve extractUuid function to handle UUID in URL (#476)
vbauzys May 26, 2022
42e2c44
Add udf support (#479)
vbauzys May 30, 2022
9667903
VDC Sharing methods (#470)
May 31, 2022
775d6ec
Add MergeMetadata and MergeMetadataAsync functions for metadata (#473)
adambarreiro Jun 3, 2022
513b534
Fix dhcp wait (#481)
vbauzys Jun 8, 2022
9c1cbfc
Adjust code owners (#484)
Didainius Jun 14, 2022
c06a6b4
Add Nsxt route advertisement methods (#478)
Jun 15, 2022
113fc60
Add support for BGP Configuration on NSX-T Edge Gateways (#480)
Didainius Jul 26, 2022
2577687
Add support for Dynamic Security Groups (#487)
Didainius Jul 27, 2022
43c1890
Add support for NSX-T Edge Gateway BGP IP Prefix lists (#488)
Didainius Jul 27, 2022
744588a
Add support for NSX-T Edge Gateway BGP Neighbor configuration (#489)
Didainius Jul 27, 2022
5376374
Update ALB Service Engine Group and ALB Settings to support Supported…
adambarreiro Jul 28, 2022
38adf67
Prepare 2.16.0 release (#492)
Didainius Aug 2, 2022
62d16aa
Prepare v2.17.0 release cycle (#493)
Didainius Aug 4, 2022
3b99bc2
Add MoRef id to VM query record type (#491)
yusufozturk Aug 5, 2022
f67f632
Go 1.19 compatibility updates (#497)
Didainius Aug 17, 2022
ea81c49
Fix Test_NsxtSecurityGroupGetAssociatedVms (#498)
Didainius Aug 23, 2022
06401aa
Add vm.Shutdown() function and tests (#496)
Didainius Aug 23, 2022
bc692c3
Add AdminOrgVdcStorageProfile for querying (improved #375) (#499)
Didainius Aug 23, 2022
ab093d7
Bump default API version to V36.0 (VCD 10.3+) (#500)
Didainius Aug 25, 2022
f1bd3a0
Add ResourcePoolRefs read support for AdminVdc type (#494)
Didainius Aug 25, 2022
df3370a
Openapi TestConnection new method (#501)
Didainius Aug 29, 2022
cc66003
Add HostName field to QueryResultVMRecordType in order to have inform…
thomsmoreau Aug 31, 2022
6176f3e
Add support for Provider VDCs read functions and upgrade OpenAPI Comp…
adambarreiro Sep 1, 2022
4c4d84b
Simplify Test_LDAP (#505)
dataclouder Sep 21, 2022
7fcefa6
Add VM Group and Logical VM Group support to facilitate VM Placement …
adambarreiro Sep 23, 2022
ce058f7
Update codeowners file (#506)
adambarreiro Sep 27, 2022
4bc993f
Improve error message when creating a duplicate VM Placement Policy (…
adambarreiro Sep 30, 2022
646e456
Add new functions to extend vApp Templates capabilities (#495)
adambarreiro Oct 19, 2022
103960d
Adjust VM code (#509)
Didainius Oct 19, 2022
1c40dcf
Add GitHub Action to run gosec and amend already present issues (#516)
adambarreiro Nov 4, 2022
017338b
Add org users to govcd test configuration (#515)
dataclouder Nov 7, 2022
b6a9b94
Catalog subscription (#511)
dataclouder Nov 14, 2022
1c0e8ea
Fix network list 514 (#518)
dataclouder Nov 14, 2022
8ca5b44
Add new metadata CRUD functions that support access level and domain …
adambarreiro Nov 15, 2022
696fea7
Add support for VDC Network Profile configuration (#512)
Didainius Nov 15, 2022
c89dfe5
Documentation and test improvements for NSX-T Network DHCP type (#517)
Didainius Nov 15, 2022
5d751d1
Trim newlines in test certificates (#519)
Didainius Nov 15, 2022
7023d30
Add new VM Placement Policy features (#513)
adambarreiro Nov 16, 2022
6d66d24
Add Media item and vApp Template query functions (#520)
adambarreiro Nov 18, 2022
10f3e08
Fix TestMediaRecordMetadata (#522)
Didainius Nov 24, 2022
59019dc
Changelog for v2.17.0 (#523)
Didainius Nov 25, 2022
b8aafa9
Prepare CHANGELOG.md for v1.18.0 cycle (#525)
dataclouder Dec 2, 2022
d9d568e
Fix issue terraform-provider-vcd-944 (#531)
dataclouder Dec 5, 2022
31e9ce0
Fix multiple resource pools issue when fetching VM Groups (#530)
adambarreiro Dec 7, 2022
d2e5b6c
Change position of BackLinkIdentifier in LDAP type (#533)
dataclouder Dec 12, 2022
68a5570
Update CHANGELOG.md with v2.18.0 changes (#534)
dataclouder Dec 14, 2022
6153ff1
Fix catalog access (#537)
dataclouder Jan 9, 2023
032f154
Fix quirks in Test_CreateOrgVdcWithFlex and Test_VMPowerOnPowerOff (#…
adambarreiro Jan 9, 2023
e7b4679
Fix test Test_CatalogAccessAsOrgUsers (#540)
dataclouder Jan 10, 2023
94f1112
Add CHANGELOG entries for v2.19.0 (#541)
dataclouder Jan 12, 2023
9819865
Prepare v2.20.0 development cycle (#542)
Didainius Jan 18, 2023
6b0cdb4
Fix invalid credential error handling in authentication process (#536)
Didainius Jan 18, 2023
384b6a5
Fix API token URL generation (#547)
dataclouder Feb 6, 2023
7ee3d7e
Adjust vet and gosec complaints (#548)
dataclouder Feb 8, 2023
b35fe48
Create Test_RenameCatalog (#546)
Feb 8, 2023
8e4c453
Add missing v2.17.0 improvement entry in changelog (#551)
adambarreiro Feb 22, 2023
687a663
Add CRUD methods that support Runtime Defined Entity (RDE) Defined In…
adambarreiro Feb 23, 2023
c58ca30
Adjust ALB Settings configuration to support IPv6 and Transparent mod…
Didainius Mar 8, 2023
58f8c31
Add CRUD methods that support Runtime Defined Entity (RDE) Types (#545)
adambarreiro Mar 10, 2023
25a0629
Add VM.GetEnvironment() to retrieve OVF Environment (#528)
odraghi Mar 10, 2023
cdc1a00
Add ipv6 support for vApp network configuration (#550)
Mar 10, 2023
aea05c4
Add distributed firewall for NSX-V VDC (#521)
dataclouder Mar 14, 2023
3c47313
remove deprecated build tags (#558)
Mar 16, 2023
ae88a73
Add CRUD methods that support Runtime Defined Entities (RDEs) (#544)
adambarreiro Mar 21, 2023
3002930
Expand NSX-T Edge Gateway support for IP allocation management (#532)
Didainius Mar 22, 2023
edf562c
NSX-T ALB Virtual Service Transparent mode and Pool Firewall Group me…
Didainius Mar 27, 2023
a8b99f7
NSX-T IPSec VPN improvements (#553)
Didainius Apr 4, 2023
22d8b44
NSX-T DHCP Binding support (#561)
Didainius Apr 12, 2023
20d6b67
NSX-T Edge Gateway QoS (rate limiting) support (#563)
Didainius Apr 13, 2023
2a4976d
Add support for DVPG backed imported NSX-T Org VDC networks (#564)
Didainius Apr 13, 2023
e9d15fd
Amend Defined Interface updates (#566)
adambarreiro Apr 18, 2023
35dc5da
Improve 'ipSliceDifference' function memory footprint (#567)
Didainius Apr 18, 2023
fe1bed6
Add ability to authorize using a Service Account (#562)
Apr 19, 2023
74f9539
v2.20.0 release (#569)
dataclouder Apr 27, 2023
b6afa00
Fix disabled org creations in 10.4.2 tests (#572)
dataclouder May 3, 2023
ad60979
Start v2.21 release cycle (#570)
Didainius May 4, 2023
dabc2d8
Skip policy clean error test in 10.4.2 (#574)
dataclouder May 8, 2023
de4d321
Replace 'takeStringPointer', 'takeIntAddress', 'takeBoolPointer' with…
Didainius May 11, 2023
aca7fec
Support Edge Gateway DHCP Forwarding endpoint (#573)
Jun 1, 2023
004ed07
Add Org SAML settings (#576)
dataclouder Jun 19, 2023
b08ab12
IP Spaces CRUD (#578)
Didainius Jun 20, 2023
d2c75b7
Add methods to create, get, publish and delete UI plugins (#575)
adambarreiro Jun 23, 2023
be0efa9
Fix UI Plugin unit tests that fail (#583)
adambarreiro Jun 29, 2023
91abc52
Provider VDC CRUD (#580)
dataclouder Jul 12, 2023
e160052
Support managing API tokens and Service Accounts (#577)
Jul 12, 2023
3b9ce5d
IP Space integration (#579)
Didainius Jul 13, 2023
17eb29e
Create Vapp from template or from other vApp (#588)
dataclouder Jul 14, 2023
e9a726b
Fix Certificate retrieval when its alias has special characters (#589)
adambarreiro Jul 14, 2023
69317f6
Add Behavior support to Defined Interfaces and Defined Entity Types (…
adambarreiro Jul 14, 2023
572755d
Add ability to ignore metadata to SDK client configuration (#581)
adambarreiro Jul 14, 2023
c7f2584
Add support for NSX-T Edge Gateway Static Routes (#586)
Didainius Jul 14, 2023
a329d75
Add support for standalone Distributed Firewall Rule management (#587)
Didainius Jul 14, 2023
49c9ba9
Edge Gateway DHCPv6 and a few IPv6 settings (#582)
Didainius Jul 17, 2023
26efe7f
Update CHANGELOG with v2.21.0 changes (#591)
dataclouder Jul 20, 2023
5fb04fa
Fix catalog creation (#590)
dataclouder Jul 26, 2023
19bb3fa
Start 2.22.0 release cycle (#596)
dataclouder Jul 26, 2023
25015a5
Remove upload binary data from logs (#593)
dataclouder Jul 26, 2023
5afbe64
Fix shell scripts (#592)
dataclouder Jul 26, 2023
3f58609
Fix vApp network related tests (#595)
dataclouder Jul 31, 2023
e688666
Fix issue tf 1098 (#598)
dataclouder Jul 31, 2023
f85a489
Fix NSX-V Edge Gateway nil pointer dereference (#594)
Jul 31, 2023
b243956
Fix Test_*OrgCreateCatalog (#602)
dataclouder Aug 2, 2023
f015d46
VappTestSuite consistent undeploy (#603)
Aug 4, 2023
6978640
Improve Test_NsxtApplicationPortProfileTenant correctness (#601)
Didainius Aug 16, 2023
54ccef7
Improve Test_InsertOrEjectMedia, address gosec issues (#608)
Didainius Aug 17, 2023
b1c22a3
Fix govcd org user tests (#606)
dataclouder Aug 17, 2023
40af6e8
Add UI Plugin test configuration (#599)
adambarreiro Aug 17, 2023
40c0bf7
Add timeout config to Makefile (#600)
adambarreiro Aug 17, 2023
0ceba8f
Add VdcGroup.ForceDelete method (#597)
Didainius Aug 17, 2023
8249086
Add explicit removal of many resources from tests (#605)
dataclouder Aug 17, 2023
ad7fd03
Bump API version to v37.0 (#609)
dataclouder Aug 22, 2023
6478351
Use verbose retry function for ALB test cleanup (#614)
Didainius Sep 5, 2023
8088fbc
Don't assume minutes in Makefile timeout (#617)
adambarreiro Sep 14, 2023
7c01ad2
VM Firmware and Boot Options support (#607)
Sep 14, 2023
4475e45
Add support for NSX-T Edge Gateway External Uplink configuration (#610)
Didainius Oct 4, 2023
f7ceaa7
Improve DefinedEntityType.SetBehaviorAccessControls method to avoid N…
adambarreiro Oct 5, 2023
b2826f9
NSX-T Edgegateway L2 VPN Tunnel session management (#619)
Oct 16, 2023
db139b2
Add specific version for gosec in security checks (#624)
dataclouder Oct 16, 2023
df27540
Media item upload any file and download (#622)
dataclouder Oct 18, 2023
7d13194
Add Vapp template lease (#623)
dataclouder Oct 24, 2023
4d1a700
Fix CustomUsersOu position in OrgLdapSettingsType (#625)
dataclouder Oct 26, 2023
598ca18
Add segment profile template support (#618)
Didainius Nov 7, 2023
4eb71f0
Add EOL check to make-changelog.sh (#626)
dataclouder Nov 8, 2023
00d27a5
Add catalog read-only sharing to all organizations (#559)
dataclouder Nov 14, 2023
315cceb
Network pools (#613)
dataclouder Nov 14, 2023
48e16bf
Amend metadata tests to be compatible with latest VCD (#629)
adambarreiro Nov 20, 2023
770c2dc
Fix metadata test (#631)
adambarreiro Nov 21, 2023
f040d9a
Fix Org user tests (#630)
dataclouder Nov 22, 2023
26dccd1
IP Space autocreate NAT and Firewall rules (#628)
Didainius Nov 23, 2023
6fc491f
Add NSX-T Edge Gateway DNS Configuration management (#627)
Nov 23, 2023
7b4db82
Add RDE and OpenAPI metadata methods (#557)
adambarreiro Nov 28, 2023
d3f64e4
Add the feature to ignore metadata for OpenAPI metadata endpoints (#632)
adambarreiro Dec 4, 2023
9837630
Add vGPU policy support (#633)
Dec 4, 2023
67e3a73
Update changelog with v2.22.0 release notes (#638)
adambarreiro Dec 12, 2023
9aa7e3e
Update staticcheck version (#640)
dataclouder Jan 3, 2024
75e6015
Update CODEOWNERS (#641)
dataclouder Jan 5, 2024
0d3cc02
Start v2.23.0 release cycle (#642)
Didainius Jan 9, 2024
babde82
Flaky test - Test_LDAP - sleep to wait for LDAP initialization (#643)
Didainius Jan 11, 2024
3741967
Add functions for generic OpenAPI CRUD handling (#644)
Didainius Jan 30, 2024
c645ba1
add UDF file format reader to support solutions add-on installation (…
vmanasiev Jan 30, 2024
3e493d6
Add IP Space floating IP suggestion method (#648)
Didainius Feb 8, 2024
9c6de90
Remove conditional API calls with outdated API version (#639)
adambarreiro Feb 21, 2024
2e4e75f
Add vm.ConsolidateDisks and vm.ConsolidateDisksAsync (#650)
Didainius Feb 22, 2024
573a44c
Add function QueryVmList (#646)
dataclouder Mar 7, 2024
e0a8d86
vApp template capture support (#652)
Didainius Mar 8, 2024
a49f044
Add methods to support CRUD operations on CSE Kubernetes clusters (#645)
adambarreiro Mar 8, 2024
69a4eda
Fix bug where CSE cluster is missing certificates when VCDKEConfig ha…
adambarreiro Mar 14, 2024
0230dca
Bump TKG map to update compatible Kubernetes versions of CSE (#655)
adambarreiro Mar 21, 2024
44c3f23
Prepare CHANGELOG.md for 2.23.0 release (#654)
dataclouder Mar 22, 2024
6736b52
Vapp network lists (#657)
dataclouder Apr 10, 2024
e29d1b1
Start v2.24.0 version (#664)
adambarreiro Apr 18, 2024
8598c11
Fix Kubernetes upgrade and SSH public key bugs in CSE (#663)
adambarreiro Apr 18, 2024
ea22527
Create changelog for v2.24.0 release (#667)
adambarreiro Apr 18, 2024
a1dee30
Start v2.25.0 (#668)
Didainius Apr 26, 2024
781f591
Patch GetSpecificApiVersionOnCondition to respect minimum API version…
Didainius Apr 26, 2024
1b16c6f
Fix Test_NsxtL2VpnTunnel for VCD 10.5.1.1+ (#659)
Didainius Apr 26, 2024
1b9648b
Improve log tracing by sending 'X-VMWARE-VCLOUD-CLIENT-REQUEST-ID' he…
Didainius Apr 26, 2024
2aed4dc
Patch XML namespace problem for vm. UpdateNetworkConnectionSection (#…
Didainius May 13, 2024
85e22f8
Vm extra configuration (#666)
dataclouder May 14, 2024
4913d51
Add code for Solution Landing Zone management [1] (#665)
Didainius May 17, 2024
e752b45
Add OIDC support (#671)
adambarreiro May 20, 2024
5257b56
Fix standalone distributed firewall rule management (#680)
Didainius May 28, 2024
6221da3
Fix CSE cluster creation when using VDC Groups (#674)
adambarreiro May 30, 2024
bdf4f5d
Fix RDE Types test (#681)
adambarreiro Jun 3, 2024
69d503a
Use guaranteed memory resources when memory overhead is included in t…
Didainius Jun 12, 2024
164f27a
Fix getOpenApiHighestElevatedVersion bug for unsupported API version …
Didainius Jun 12, 2024
c47027a
Fix invalid VDC configuration in tests (#685)
Didainius Jun 13, 2024
5379f18
Add new field ActionValue to types. NsxtFirewallRule to support REJEC…
Didainius Jun 13, 2024
af1e038
Add Autoscaler support to existing CSE methods and types (#678)
adambarreiro Jun 14, 2024
e556501
Skip TestClient_RetrieveRemoteDoc conditionally (#687)
dataclouder Jun 17, 2024
dd98244
Solution Add-On upload [2] (#670)
Didainius Jun 19, 2024
3d05fb3
Fix OpenAPIEdgeGatewayEdgeCluster struct (#688)
adambarreiro Jun 19, 2024
c6d395d
Add support for topology intentions to provider gateways (VCD 10.5.1+…
Didainius Jun 19, 2024
3167110
Support NSX-T Edge Gatway IP count limits (#682)
Didainius Jun 19, 2024
a3c4900
Add VDC Template support (#686)
adambarreiro Jun 20, 2024
6bcb3f4
Site and org associations (#669)
dataclouder Jun 24, 2024
d244dc2
Add DetectedGuestOS to QueryResultVMRecordType (#673)
slargo Jun 25, 2024
e0d91e5
Solution Add-On instance and publishing [3] (#679)
Didainius Jun 25, 2024
ae36be0
Fix extraconfig xml (#690)
dataclouder Jun 27, 2024
a180727
Data Solution Extension (DSE) initial support (#689)
Didainius Jun 27, 2024
e415876
Add namespaces to VM extra config methods (#691)
adambarreiro Jul 2, 2024
cf36d5e
Add CHANGELOG items for v2.25.0 (#692)
dataclouder Jul 2, 2024
7077949
Add necessary fields to types file
alexanselmo Jul 15, 2024
a09e662
Delete CODEOWNERS
alexanselmo Jul 15, 2024
9863413
Version for attempting to use multiple libraries
alexanselmo Jul 15, 2024
06a38c2
Revert "Version for attempting to use multiple libraries"
alexanselmo Jul 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Go 1.19 compatibility updates (vmware#497)
Didainius authored Aug 17, 2022
commit f67f6327ea3e3e0b839701f3f13305ab690bcd67
11 changes: 11 additions & 0 deletions .changes/v2.17.0/497-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
* Ran `make fmt` using Go 1.19 release (`fmt` automatically changes doc comment structure). This
will prevent `make static` errors when running tests in pipeline using Go 1.19 [GH-497]
* Updated branding `vCloud Director` -> `VMware Cloud Director` [GH-497]
* Go officially supports 2 last releases. With Go 1.19 being released it means that Go 1.18 is the
minimum officially supported Go version and this set our hands free to use generics in this SDK
(if there is a need for it). `go.mod` is updated to reflect Go minimum version 1.18 [GH-497]
* package `io/ioutil` is deprecated as of Go 1.16. `staticcheck` started complaining about usage of
deprecated packages. As a result this PR switches packages to either `io` or `os` (still the same
functions are used) [GH-497]
* `staticcheck` switched version naming from `2021.1.2` to `v0.3.3` in download section. This PR
also updates code to fetch correct one [GH-497]
6 changes: 3 additions & 3 deletions .github/workflows/check-code.yml
Original file line number Diff line number Diff line change
@@ -11,12 +11,12 @@ jobs:
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ^1.17
go-version: '1.19'

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: vet
run: make vet
9 changes: 3 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -8,8 +8,8 @@ request. For any questions about the CLA process, please refer to our

## Community

vCloud Director Golang and Terraform contributors can be found here:
https://vmwarecode.slack.com, vcd-terraform-dev#
VMware Cloud Director Go(lang) and Terraform contributors can be found here:
https://vmwarecode.slack.com, #vcd-terraform-dev

## Logging Bugs

@@ -83,10 +83,7 @@ of the repo for pull requests back to go-vcloud-director.
### Clone and Set Upstream Remote

Make a local clone of the forked repo and add the base go-vcloud-director
repo as the upstream remote repository.

The project uses Go modules so the path is up to you, but do not forget
to set `GO111MODULE=on` if you are in `GOPATH`
repo as the upstream remote repository. The project uses Go modules so the path is up to you.

``` shell

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# go-vcloud-director [![GoDoc](https://godoc.org/github.com/vmware/go-vcloud-director?status.svg)](http://godoc.org/github.com/vmware/go-vcloud-director) [![Chat](https://img.shields.io/badge/chat-on%20slack-brightgreen.svg)](https://vmwarecode.slack.com/messages/CBBBXVB16)

This repo contains the `go-vcloud-director` package which implements
an SDK for vCloud Director. The project serves the needs of Golang
developers who need to integrate with vCloud Director. It is also the
an SDK for VMware Cloud Director. The project serves the needs of Golang
developers who need to integrate with VMware Cloud Director. It is also the
basis of the [vCD Terraform
Provider](https://github.com/vmware/terraform-provider-vcd).

8 changes: 6 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
module github.com/vmware/go-vcloud-director/v2

go 1.16
go 1.18

require (
github.com/araddon/dateparse v0.0.0-20190622164848-0fb0a474d195
github.com/davecgh/go-spew v1.1.0
github.com/hashicorp/go-version v1.2.0
github.com/kr/pretty v0.2.1
github.com/peterhellberg/link v1.1.0
github.com/stretchr/testify v1.5.1 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
gopkg.in/yaml.v2 v2.2.2
)

require (
github.com/kr/text v0.1.0 // indirect
github.com/stretchr/testify v1.5.1 // indirect
)

replace (
gopkg.in/check.v1 => github.com/go-check/check v0.0.0-20201130134442-10cb98267c6c
gopkg.in/yaml.v2 => github.com/go-yaml/yaml/v2 v2.2.2
2 changes: 1 addition & 1 deletion govcd/admincatalog.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
"github.com/vmware/go-vcloud-director/v2/types/v56"
)

// AdminCatalog is a admin view of a vCloud Director Catalog
// AdminCatalog is a admin view of a VMware Cloud Director Catalog
// To be able to get an AdminCatalog representation, users must have
// admin credentials to the System org. AdminCatalog is used
// for creating, updating, and deleting a Catalog.
12 changes: 6 additions & 6 deletions govcd/adminorg.go
Original file line number Diff line number Diff line change
@@ -123,8 +123,8 @@ func (adminOrg *AdminOrg) GetStorageProfileReferenceById(id string, refresh bool
ErrorEntityNotFound, id, adminOrg.AdminOrg.Name)
}

// Deletes the org, returning an error if the vCD call fails.
// API Documentation: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/DELETE-Organization.html
// Deletes the org, returning an error if the vCD call fails.
// API Documentation: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/DELETE-Organization.html
func (adminOrg *AdminOrg) Delete(force bool, recursive bool) error {
if force && recursive {
//undeploys vapps
@@ -191,10 +191,10 @@ func (adminOrg *AdminOrg) Disable() error {
return adminOrg.client.ExecuteRequestWithoutResponse(orgHREF.String(), http.MethodPost, "", "error disabling organization: %s", nil)
}

// Updates the Org definition from current org struct contents.
// Any differences that may be legally applied will be updated.
// Returns an error if the call to vCD fails.
// API Documentation: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/PUT-Organization.html
// Updates the Org definition from current org struct contents.
// Any differences that may be legally applied will be updated.
// Returns an error if the call to vCD fails.
// API Documentation: https://code.vmware.com/apis/220/vcloud#/doc/doc/operations/PUT-Organization.html
func (adminOrg *AdminOrg) Update() (Task, error) {
vcomp := &types.AdminOrg{
Xmlns: types.XMLNamespaceVCloud,
33 changes: 19 additions & 14 deletions govcd/api.go
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* Copyright 2021 VMware, Inc. All rights reserved. Licensed under the Apache v2 License.
*/

// Package govcd provides a simple binding for vCloud Director REST APIs.
// Package govcd provides a simple binding for VMware Cloud Director REST APIs.
package govcd

import (
@@ -11,7 +11,6 @@ import (
"encoding/xml"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
@@ -23,7 +22,7 @@ import (
"github.com/vmware/go-vcloud-director/v2/util"
)

// Client provides a client to vCloud Director, values can be populated automatically using the Authenticate method.
// Client provides a client to VMware Cloud Director, values can be populated automatically using the Authenticate method.
type Client struct {
APIVersion string // The API version required
VCDToken string // Access Token (authorization header)
@@ -35,7 +34,7 @@ type Client struct {
UsingAccessToken bool // flag if client is using an API token

// MaxRetryTimeout specifies a time limit (in seconds) for retrying requests made by the SDK
// where vCloud director may take time to respond and retry mechanism is needed.
// where VMware Cloud Director may take time to respond and retry mechanism is needed.
// This must be >0 to avoid instant timeout errors.
MaxRetryTimeout int

@@ -68,9 +67,10 @@ const ApiTokenHeader = "API-token"
// General purpose error to be used whenever an entity is not found from a "GET" request
// Allows a simpler checking of the call result
// such as
// if err == ErrorEntityNotFound {
// // do what is needed in case of not found
// }
//
// if err == ErrorEntityNotFound {
// // do what is needed in case of not found
// }
var errorEntityNotFoundMessage = "[ENF] entity not found"
var ErrorEntityNotFound = fmt.Errorf(errorEntityNotFoundMessage)

@@ -79,12 +79,14 @@ var debugShowRequestEnabled = os.Getenv("GOVCD_SHOW_REQ") != ""
var debugShowResponseEnabled = os.Getenv("GOVCD_SHOW_RESP") != ""

// Enables the debugging hook to show requests as they are processed.
//
//lint:ignore U1000 this function is used on request for debugging purposes
func enableDebugShowRequest() {
debugShowRequestEnabled = true
}

// Disables the debugging hook to show requests as they are processed.
//
//lint:ignore U1000 this function is used on request for debugging purposes
func disableDebugShowRequest() {
debugShowRequestEnabled = false
@@ -95,12 +97,14 @@ func disableDebugShowRequest() {
}

// Enables the debugging hook to show responses as they are processed.
//
//lint:ignore U1000 this function is used on request for debugging purposes
func enableDebugShowResponse() {
debugShowResponseEnabled = true
}

// Disables the debugging hook to show responses as they are processed.
//
//lint:ignore U1000 this function is used on request for debugging purposes
func disableDebugShowResponse() {
debugShowResponseEnabled = false
@@ -149,9 +153,10 @@ func debugShowResponse(resp *http.Response, body []byte) {

// IsNotFound is a convenience function, similar to os.IsNotExist that checks whether a given error
// is a "Not found" error, such as
// if isNotFound(err) {
// // do what is needed in case of not found
// }
//
// if isNotFound(err) {
// // do what is needed in case of not found
// }
func IsNotFound(err error) bool {
return err != nil && err == ErrorEntityNotFound
}
@@ -203,7 +208,7 @@ func (client *Client) newRequest(params map[string]string, notEncodedParams map[
var readBody []byte
var err error
if body != nil {
readBody, err = ioutil.ReadAll(body)
readBody, err = io.ReadAll(body)
if err != nil {
util.Logger.Printf("[DEBUG - newRequest] error reading body: %s", err)
}
@@ -294,7 +299,7 @@ func ParseErr(bodyType types.BodyType, resp *http.Response, errType error) error

// decodeBody is used to decode a response body of types.BodyType
func decodeBody(bodyType types.BodyType, resp *http.Response, out interface{}) error {
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)

// In case of JSON, body does not have indents in response therefore it must be indented
if bodyType == types.BodyTypeJSON {
@@ -599,12 +604,12 @@ func (client *Client) ExecuteParamRequestWithCustomError(pathURL string, params
// read from resp.Body io.Reader for debug output if it has body
var bodyBytes []byte
if resp.Body != nil {
bodyBytes, err = ioutil.ReadAll(resp.Body)
bodyBytes, err = io.ReadAll(resp.Body)
if err != nil {
return &http.Response{}, fmt.Errorf("could not read response body: %s", err)
}
// Restore the io.ReadCloser to its original state with no-op closer
resp.Body = ioutil.NopCloser(bytes.NewBuffer(bodyBytes))
resp.Body = io.NopCloser(bytes.NewBuffer(bodyBytes))
}

util.ProcessResponseOutput(util.FuncNameCallStack(), resp, string(bodyBytes))
4 changes: 2 additions & 2 deletions govcd/api_token.go
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/url"
"strings"
@@ -67,7 +67,7 @@ func (vcdClient *VCDClient) GetBearerTokenFromApiToken(org, token string) (*type
var body []byte
var tokenDef types.ApiTokenRefresh
if resp.Body != nil {
body, err = ioutil.ReadAll(resp.Body)
body, err = io.ReadAll(resp.Body)
}

// The default response data to show in the logs is a string of asterisks
8 changes: 4 additions & 4 deletions govcd/api_token_test.go
Original file line number Diff line number Diff line change
@@ -17,10 +17,10 @@ import (

// TestVCDClient_GetBearerTokenFromApiToken tests the token refresh operation
// To make it work, we need the following, or the test is skipped:
// * VCD version 10.3.1 or greater
// * environment variable TEST_VCD_API_TOKEN filled with a valid API token for that VCD
// * If the API token was not set for the Organization defined in vcd.config.VCD.Org, the variable
// TEST_VCD_ORG should be filled with the name of the Org for which the API token was set.
// - VCD version 10.3.1 or greater
// - environment variable TEST_VCD_API_TOKEN filled with a valid API token for that VCD
// - If the API token was not set for the Organization defined in vcd.config.VCD.Org, the variable
// TEST_VCD_ORG should be filled with the name of the Org for which the API token was set.
func (vcd *TestVCD) TestVCDClient_GetBearerTokenFromApiToken(check *C) {

apiToken := os.Getenv("TEST_VCD_API_TOKEN")
8 changes: 4 additions & 4 deletions govcd/api_vcd.go
Original file line number Diff line number Diff line change
@@ -102,7 +102,7 @@ func (vcdClient *VCDClient) vcdCloudApiAuthorize(user, pass, org string) (*http.
return resp, nil
}

// NewVCDClient initializes VMware vCloud Director client with reasonable defaults.
// NewVCDClient initializes VMware VMware Cloud Director client with reasonable defaults.
// It accepts functions of type VCDClientOption for adjusting defaults.
func NewVCDClient(vcdEndpoint url.URL, insecure bool, options ...VCDClientOption) *VCDClient {
minVcdApiVersion := "35.0" // supported by 10.2+
@@ -151,7 +151,7 @@ func NewVCDClient(vcdEndpoint url.URL, insecure bool, options ...VCDClientOption
return vcdClient
}

// Authenticate is a helper function that performs a login in vCloud Director.
// Authenticate is a helper function that performs a login in VMware Cloud Director.
func (vcdClient *VCDClient) Authenticate(username, password, org string) error {
_, err := vcdClient.GetAuthResponse(username, password, org)
return err
@@ -240,7 +240,7 @@ func (vcdClient *VCDClient) SetToken(org, authHeader, token string) error {
return nil
}

// Disconnect performs a disconnection from the vCloud Director API endpoint.
// Disconnect performs a disconnection from the VMware Cloud Director API endpoint.
func (vcdClient *VCDClient) Disconnect() error {
if vcdClient.Client.VCDToken == "" && vcdClient.Client.VCDAuthHeader == "" {
return fmt.Errorf("cannot disconnect, client is not authenticated")
@@ -251,7 +251,7 @@ func (vcdClient *VCDClient) Disconnect() error {
// Set Authorization Header
req.Header.Add(vcdClient.Client.VCDAuthHeader, vcdClient.Client.VCDToken)
if _, err := checkResp(vcdClient.Client.Http.Do(req)); err != nil {
return fmt.Errorf("error processing session delete for vCloud Director: %s", err)
return fmt.Errorf("error processing session delete for VMware Cloud Director: %s", err)
}
return nil
}
5 changes: 2 additions & 3 deletions govcd/api_vcd_test.go
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@ import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
@@ -305,7 +304,7 @@ func readCleanupList() ([]CleanupEntity, error) {
if os.IsNotExist(err) {
return nil, err
}
listText, err := ioutil.ReadFile(persistentCleanupListFile)
listText, err := os.ReadFile(persistentCleanupListFile)
if err != nil {
return nil, err
}
@@ -434,7 +433,7 @@ func GetConfigStruct() (TestConfig, error) {
if os.IsNotExist(err) {
return TestConfig{}, fmt.Errorf("Configuration file %s not found: %s", config, err)
}
yamlFile, err := ioutil.ReadFile(config)
yamlFile, err := os.ReadFile(config)
if err != nil {
return TestConfig{}, fmt.Errorf("could not read config file %s: %s", config, err)
}
4 changes: 2 additions & 2 deletions govcd/api_vcd_test_unit.go
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
package govcd

import (
"io/ioutil"
"io"
"os"
"testing"
)
@@ -35,7 +35,7 @@ func goldenString(t *testing.T, goldenFile string, actual string, update bool) s
return actual
}

content, err := ioutil.ReadAll(f)
content, err := io.ReadAll(f)
if err != nil {
t.Fatalf("error opening file %s: %s", goldenPath, err)
}
11 changes: 7 additions & 4 deletions govcd/api_vcd_versions.go
Original file line number Diff line number Diff line change
@@ -323,12 +323,15 @@ func intListToVersion(digits []int, atMost int) string {
// VersionEqualOrGreater return true if the current version is the same or greater than the one being compared.
// If howManyDigits is > 3, the comparison includes the build.
// Examples:
// client version is 1.2.3.1234
// compare version is 1.2.3.2000
//
// client version is 1.2.3.1234
// compare version is 1.2.3.2000
//
// function return true if howManyDigits is <= 3, but false if howManyDigits is > 3
//
// client version is 1.2.3.1234
// compare version is 1.1.1.0
// client version is 1.2.3.1234
// compare version is 1.1.1.0
//
// function returns true regardless of value of howManyDigits
func (client *Client) VersionEqualOrGreater(compareTo string, howManyDigits int) (bool, error) {

16 changes: 8 additions & 8 deletions govcd/catalog.go
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"math"
"net/http"
"net/url"
@@ -499,7 +498,7 @@ func uploadOvfDescription(client *Client, ovfFile string, ovfUploadUrl *url.URL)
}

func parseOvfFileDesc(file *os.File, ovfFileDesc *Envelope) error {
ovfXml, err := ioutil.ReadAll(file)
ovfXml, err := io.ReadAll(file)
if err != nil {
return err
}
@@ -611,12 +610,13 @@ func createItemWithLink(client *Client, createHREF *url.URL, catalogItemName, it
}

// Helper method to get path to multi-part files.
//For example a file called test.vmdk with total_file_size = 100 bytes and part_size = 40 bytes, implies the file is made of *3* part files.
// - test.vmdk.000000000 = 40 bytes
// - test.vmdk.000000001 = 40 bytes
// - test.vmdk.000000002 = 20 bytes
//Say base_dir = /dummy_path/, and base_file_name = test.vmdk then
//the output of this function will be [/dummy_path/test.vmdk.000000000,
// For example a file called test.vmdk with total_file_size = 100 bytes and part_size = 40 bytes, implies the file is made of *3* part files.
// - test.vmdk.000000000 = 40 bytes
// - test.vmdk.000000001 = 40 bytes
// - test.vmdk.000000002 = 20 bytes
//
// Say base_dir = /dummy_path/, and base_file_name = test.vmdk then
// the output of this function will be [/dummy_path/test.vmdk.000000000,
// /dummy_path/test.vmdk.000000001, /dummy_path/test.vmdk.000000002]
func getChunkedFilePaths(baseDir, baseFileName string, totalFileSize, partSize int) []string {
var filePaths []string
8 changes: 4 additions & 4 deletions govcd/catalog_test.go
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ package govcd

import (
"fmt"
"io/ioutil"
"io"
"log"
"os"
"strings"
@@ -232,7 +232,7 @@ func (vcd *TestVCD) Test_UploadOvf_ShowUploadProgress_works(check *C) {
check.Assert(err, IsNil)
w.Close()
//read stdin
result, _ := ioutil.ReadAll(r)
result, _ := io.ReadAll(r)
os.Stdout = oldStdout

err = uploadTask.WaitTaskCompletion()
@@ -323,7 +323,7 @@ func (vcd *TestVCD) Test_UploadOvf_withoutVMDKSize(check *C) {
}

func countFolders() int {
files, err := ioutil.ReadDir(os.TempDir())
files, err := os.ReadDir(os.TempDir())
if err != nil {
log.Fatal(err)
}
@@ -476,7 +476,7 @@ func (vcd *TestVCD) Test_CatalogUploadMediaImage_ShowUploadProgress_works(check
check.Assert(err, IsNil)
w.Close()
//read stdin
result, _ := ioutil.ReadAll(r)
result, _ := io.ReadAll(r)
os.Stdout = oldStdout

err = uploadTask.WaitTaskCompletion()
4 changes: 2 additions & 2 deletions govcd/common_test.go
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ package govcd
import (
"errors"
"fmt"
"io/ioutil"
"io"
"net"
"net/http"
"net/url"
@@ -197,7 +197,7 @@ func testGetEdgeEndpointXML(endpoint string, edge EdgeGateway, check *C) string

defer resp.Body.Close()

body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
check.Assert(err, IsNil)

return string(body)
26 changes: 13 additions & 13 deletions govcd/entity.go
Original file line number Diff line number Diff line change
@@ -11,19 +11,19 @@ type genericGetter func(string, bool) (interface{}, error)
// On failure, returns a nil pointer and an error
// Example usage:
//
// func (org *Org) GetCatalogByNameOrId(identifier string, refresh bool) (*Catalog, error) {
// getByName := func(name string, refresh bool) (interface{}, error) {
// return org.GetCatalogByName(name, refresh)
// }
// getById := func(id string, refresh bool) (interface{}, error) {
// return org.GetCatalogById(id, refresh)
// }
// entity, err := getEntityByNameOrId(getByName, getById, identifier, refresh)
// if entity != nil {
// return nil, err
// }
// return entity.(*Catalog), err
// }
// func (org *Org) GetCatalogByNameOrId(identifier string, refresh bool) (*Catalog, error) {
// getByName := func(name string, refresh bool) (interface{}, error) {
// return org.GetCatalogByName(name, refresh)
// }
// getById := func(id string, refresh bool) (interface{}, error) {
// return org.GetCatalogById(id, refresh)
// }
// entity, err := getEntityByNameOrId(getByName, getById, identifier, refresh)
// if entity != nil {
// return nil, err
// }
// return entity.(*Catalog), err
// }
func getEntityByNameOrId(getByName, getById genericGetter, identifier string, refresh bool) (interface{}, error) {

var byNameErr, byIdErr error
44 changes: 22 additions & 22 deletions govcd/entity_test.go
Original file line number Diff line number Diff line change
@@ -91,31 +91,31 @@ func (vmar *VmAffinityRule) id() string { return vmar.VmAffinityRule.ID }
// and within the caller it must define the getter functions
// Example usage:
//
// func (vcd *TestVCD) Test_OrgGetVdc(check *C) {
// if vcd.config.VCD.Org == "" {
// check.Skip("Test_OrgGetVdc: Org name not given.")
// return
// }
// org, err := vcd.client.GetOrgByName(vcd.config.VCD.Org)
// check.Assert(err, IsNil)
// check.Assert(org, NotNil)
// func (vcd *TestVCD) Test_OrgGetVdc(check *C) {
// if vcd.config.VCD.Org == "" {
// check.Skip("Test_OrgGetVdc: Org name not given.")
// return
// }
// org, err := vcd.client.GetOrgByName(vcd.config.VCD.Org)
// check.Assert(err, IsNil)
// check.Assert(org, NotNil)
//
// getByName := func(name string, refresh bool) (genericEntity, error) { return org.GetVDCByName(name, refresh) }
// getById := func(id string, refresh bool) (genericEntity, error) { return org.GetVDCById(id, refresh) }
// getByNameOrId := func(id string, refresh bool) (genericEntity, error) { return org.GetVDCByNameOrId(id, refresh) }
// getByName := func(name string, refresh bool) (genericEntity, error) { return org.GetVDCByName(name, refresh) }
// getById := func(id string, refresh bool) (genericEntity, error) { return org.GetVDCById(id, refresh) }
// getByNameOrId := func(id string, refresh bool) (genericEntity, error) { return org.GetVDCByNameOrId(id, refresh) }
//
// var def = getterTestDefinition{
// parentType: "Org",
// parentName: vcd.config.VCD.Org,
// entityType: "Vdc",
// getterPrefix: "VDC",
// entityName: vcd.config.VCD.Vdc,
// getByName: getByName,
// getById: getById,
// getByNameOrId: getByNameOrId,
// var def = getterTestDefinition{
// parentType: "Org",
// parentName: vcd.config.VCD.Org,
// entityType: "Vdc",
// getterPrefix: "VDC",
// entityName: vcd.config.VCD.Vdc,
// getByName: getByName,
// getById: getById,
// getByNameOrId: getByNameOrId,
// }
// vcd.testFinderGetGenericEntity(def, check)
// }
// vcd.testFinderGetGenericEntity(def, check)
// }
func (vcd *TestVCD) testFinderGetGenericEntity(def getterTestDefinition, check *C) {
entityName := def.entityName
if entityName == "" {
66 changes: 36 additions & 30 deletions govcd/filter_condition.go
Original file line number Diff line number Diff line change
@@ -51,12 +51,13 @@ type parentIdCondition struct {

// matchParent matches the wanted parent name (passed in 'stored') to the parent of the queryItem
// Input:
// * stored: the data of the condition (a parentCondition)
// * item: a QueryItem
// - stored: the data of the condition (a parentCondition)
// - item: a QueryItem
//
// Returns:
// * bool: the result of the comparison
// * string: a description of the operation
// * error: an error when the input is not as expected
// - bool: the result of the comparison
// - string: a description of the operation
// - error: an error when the input is not as expected
func matchParent(stored, item interface{}) (bool, string, error) {
condition, ok := stored.(parentCondition)
if !ok {
@@ -74,12 +75,13 @@ func matchParent(stored, item interface{}) (bool, string, error) {
// matchParentId matches the wanted parent ID (passed in 'stored') to the parent ID of the queryItem
// The IDs being compared are filtered through extractUuid, to make them homogeneous
// Input:
// * stored: the data of the condition (a parentCondition)
// * item: a QueryItem
// - stored: the data of the condition (a parentCondition)
// - item: a QueryItem
//
// Returns:
// * bool: the result of the comparison
// * string: a description of the operation
// * error: an error when the input is not as expected
// - bool: the result of the comparison
// - string: a description of the operation
// - error: an error when the input is not as expected
func matchParentId(stored, item interface{}) (bool, string, error) {
condition, ok := stored.(parentIdCondition)
if !ok {
@@ -98,12 +100,13 @@ func matchParentId(stored, item interface{}) (bool, string, error) {

// matchName matches a name (passed in 'stored') to the name of the queryItem
// Input:
// * stored: the data of the condition (a nameCondition)
// * item: a QueryItem
// - stored: the data of the condition (a nameCondition)
// - item: a QueryItem
//
// Returns:
// * bool: the result of the comparison
// * string: a description of the operation
// * error: an error when the input is not as expected
// - bool: the result of the comparison
// - string: a description of the operation
// - error: an error when the input is not as expected
func matchName(stored, item interface{}) (bool, string, error) {
re, ok := stored.(nameCondition)
if !ok {
@@ -118,12 +121,13 @@ func matchName(stored, item interface{}) (bool, string, error) {

// matchIp matches an IP (passed in 'stored') to the IP of the queryItem
// Input:
// * stored: the data of the condition (an ipCondition)
// * item: a QueryItem
// - stored: the data of the condition (an ipCondition)
// - item: a QueryItem
//
// Returns:
// * bool: the result of the comparison
// * string: a description of the operation
// * error: an error when the input is not as expected
// - bool: the result of the comparison
// - string: a description of the operation
// - error: an error when the input is not as expected
func matchIp(stored, item interface{}) (bool, string, error) {
re, ok := stored.(ipCondition)
if !ok {
@@ -142,12 +146,13 @@ func matchIp(stored, item interface{}) (bool, string, error) {

// matchDate matches a date (passed in 'stored') to the date of the queryItem
// Input:
// * stored: the data of the condition (a dateCondition)
// * item: a QueryItem
// - stored: the data of the condition (a dateCondition)
// - item: a QueryItem
//
// Returns:
// * bool: the result of the comparison
// * string: a description of the operation
// * error: an error when the input is not as expected
// - bool: the result of the comparison
// - string: a description of the operation
// - error: an error when the input is not as expected
func matchDate(stored, item interface{}) (bool, string, error) {
expr, ok := stored.(dateCondition)
if !ok {
@@ -167,12 +172,13 @@ func matchDate(stored, item interface{}) (bool, string, error) {

// matchMetadata matches a value (passed in 'stored') to the metadata value retrieved from queryItem
// Input:
// * stored: the data of the condition (a metadataRegexpCondition)
// * item: a QueryItem
// - stored: the data of the condition (a metadataRegexpCondition)
// - item: a QueryItem
//
// Returns:
// * bool: the result of the comparison
// * string: a description of the operation
// * error: an error when the input is not as expected
// - bool: the result of the comparison
// - string: a description of the operation
// - error: an error when the input is not as expected
func matchMetadata(stored, item interface{}) (bool, string, error) {
re, ok := stored.(metadataRegexpCondition)
if !ok {
3 changes: 2 additions & 1 deletion govcd/filter_util.go
Original file line number Diff line number Diff line change
@@ -117,7 +117,8 @@ func (fd *FilterDef) AddMetadataFilter(key, value, valueType string, isSystem, u

// stringToBool converts a string to a bool
// The following values are recognized as TRUE:
// t, true, y, yes, ok
//
// t, true, y, yes, ok
func stringToBool(s string) bool {
switch strings.ToLower(s) {
case "t", "true", "y", "yes", "ok":
4 changes: 2 additions & 2 deletions govcd/lb_test.go
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ package govcd

import (
"fmt"
"io/ioutil"
"io"
"net/http"
"strings"
"time"
@@ -203,7 +203,7 @@ func checkLb(queryUrl string, expectedResponses []string, maxRetryTimeout int) e

if err == nil {
fmt.Printf(".") // progress bar when waiting for responses from all nodes
body, _ := ioutil.ReadAll(resp.Body)
body, _ := io.ReadAll(resp.Body)
resp.Body.Close()
// check if the element is in the list
for index, value := range expectedResponses {
2 changes: 1 addition & 1 deletion govcd/monitor.go
Original file line number Diff line number Diff line change
@@ -163,7 +163,7 @@ func prettyTask(task *types.Task) string {
}

// Returns an Edge Gateway service configuration structure as JSON
//func prettyEdgeGatewayServiceConfiguration(conf types.EdgeGatewayServiceConfiguration) string {
// func prettyEdgeGatewayServiceConfiguration(conf types.EdgeGatewayServiceConfiguration) string {
func prettyEdgeGateway(egw types.EdgeGateway) string {
result := ""
byteBuf, err := json.MarshalIndent(egw, " ", " ")
2 changes: 1 addition & 1 deletion govcd/nsxt_ipsec_vpn_tunnel.go
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ func (egw *NsxtEdgeGateway) GetAllIpSecVpnTunnels(queryParameters url.Values) ([
return wrappedResponses, nil
}

//GetIpSecVpnTunnelById retrieves single IPsec VPN Tunnel by ID
// GetIpSecVpnTunnelById retrieves single IPsec VPN Tunnel by ID
func (egw *NsxtEdgeGateway) GetIpSecVpnTunnelById(id string) (*NsxtIpSecVpnTunnel, error) {
if id == "" {
return nil, fmt.Errorf("canot find NSX-T IPsec VPN Tunnel configuration without ID")
3 changes: 1 addition & 2 deletions govcd/openapi.go
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"reflect"
@@ -636,7 +635,7 @@ func (client *Client) newOpenApiRequest(apiVersion string, params url.Values, me
var readBody []byte
var err error
if body != nil {
readBody, err = ioutil.ReadAll(body)
readBody, err = io.ReadAll(body)
if err != nil {
util.Logger.Printf("[DEBUG - newOpenApiRequest] error reading body: %s", err)
}
4 changes: 3 additions & 1 deletion govcd/saml_auth_test.go
Original file line number Diff line number Diff line change
@@ -12,7 +12,9 @@ import (
)

// Test_SamlAdfsAuth checks if SAML ADFS login works using WS-TRUST endpoint
// "/adfs/services/trust/13/usernamemixed".
//
// "/adfs/services/trust/13/usernamemixed".
//
// Credential variables must be specified in test configuration for it to work
// The steps of this test are:
// * Query object using test framework vCD connection
4 changes: 2 additions & 2 deletions govcd/saml_auth_unit_test.go
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
package govcd

import (
"io/ioutil"
"io"
"log"
"net/http"
"net/http/httptest"
@@ -174,7 +174,7 @@ func (mockServer *samlMockServer) adfsSamlAuthHandler(w http.ResponseWriter, r *
}

// Replace known dynamic strings to 'REPLACED' string
gotBody, _ := ioutil.ReadAll(r.Body)
gotBody, _ := io.ReadAll(r.Body)
gotBodyString := string(gotBody)
re := regexp.MustCompile(`(<a:To s:mustUnderstand="1">).*(</a:To>)`)
gotBodyString = re.ReplaceAllString(gotBodyString, `${1}REPLACED${2}`)
2 changes: 1 addition & 1 deletion govcd/sample_govcd_test_config.yaml
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ provider:
# The organization you are authenticating with
sysOrg: System
# (Optional) MaxRetryTimeout specifies a time limit (in seconds) for retrying requests made by the SDK
# where vCloud director may take time to respond and retry mechanism is needed.
# where VMware Cloud Director may take time to respond and retry mechanism is needed.
# This must be >0 to avoid instant timeout errors. If omitted - default value is set.
# maxRetryTimeout: 60
#
5 changes: 3 additions & 2 deletions govcd/task.go
Original file line number Diff line number Diff line change
@@ -31,8 +31,9 @@ func NewTask(cli *Client) *Task {
// If the error is not nil, composes an error message
// made of the error itself + the information from the task's Error component.
// See:
// https://code.vmware.com/apis/220/vcloud#/doc/doc/types/TaskType.html
// https://code.vmware.com/apis/220/vcloud#/doc/doc/types/ErrorType.html
//
// https://code.vmware.com/apis/220/vcloud#/doc/doc/types/TaskType.html
// https://code.vmware.com/apis/220/vcloud#/doc/doc/types/ErrorType.html
func (task *Task) getErrorMessage(err error) string {
errorMessage := ""
if err != nil {
5 changes: 3 additions & 2 deletions govcd/user.go
Original file line number Diff line number Diff line change
@@ -337,8 +337,9 @@ func (user *OrgUser) GetRoleName() string {
// Expected behaviour:
// with takeOwnership = true, all entities owned by the user being deleted will be transferred to the caller.
// with takeOwnership = false, if the user own catalogs, networks, or running VMs/vApps, the call will fail.
// If the user owns only powered-off VMs/vApps, the call will succeeds and the
// VMs/vApps will be removed.
//
// If the user owns only powered-off VMs/vApps, the call will succeeds and the
// VMs/vApps will be removed.
func (user *OrgUser) Delete(takeOwnership bool) error {
util.Logger.Printf("[TRACE] Deleting user: %#v (take ownership: %v)", user.User.Name, takeOwnership)

12 changes: 6 additions & 6 deletions govcd/vm_affinity_rule.go
Original file line number Diff line number Diff line change
@@ -157,12 +157,12 @@ func (vdc *Vdc) GetVmAffinityRuleByNameOrId(identifier string) (*VmAffinityRule,
// validateAffinityRule checks that a VM affinity rule has all the needed properties
// If checkVMs is true, then the function checks that all VMs in the internal list exist.
// The usual workflow is:
// 1. validation without VM checking
// 2. creation or update
// 3. if no error -> end
// 4. if error, validation with VM checks
// 4a. if validation error, it was a VM issue: return combined original error + validation error
// 4b. if no validation error, the failure was due to something else: return only original error
// 1. validation without VM checking
// 2. creation or update
// 3. if no error -> end
// 4. if error, validation with VM checks
// 4a. if validation error, it was a VM issue: return combined original error + validation error
// 4b. if no validation error, the failure was due to something else: return only original error
func validateAffinityRule(client *Client, affinityRuleDef *types.VmAffinityRule, checkVMs bool) (*types.VmAffinityRule, error) {
if affinityRuleDef == nil {
return nil, fmt.Errorf("empty definition given for a VM affinity rule")
4 changes: 1 addition & 3 deletions samples/discover/discover.go
Original file line number Diff line number Diff line change
@@ -46,8 +46,6 @@ import (
"net/url"
"os"

"io/ioutil"

"gopkg.in/yaml.v2"

"github.com/vmware/go-vcloud-director/v2/govcd"
@@ -96,7 +94,7 @@ func check_configuration(conf Config) {
// Retrieves the configuration from a Json or Yaml file
func getConfig(config_file string) Config {
var configuration Config
buffer, err := ioutil.ReadFile(config_file)
buffer, err := os.ReadFile(config_file)
if err != nil {
fmt.Printf("Configuration file %s not found\n%s\n", config_file, err)
os.Exit(1)
3 changes: 1 addition & 2 deletions scripts/staticcheck-config.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export STATICCHECK_URL=https://github.com/dominikh/go-tools/releases/download
export STATICCHECK_VERSION=2022.1
export STATICCHECK_VERSION=v0.3.3
export STATICCHECK_FILE=staticcheck_linux_amd64.tar.gz

2 changes: 1 addition & 1 deletion types/v56/nsxt_types.go
Original file line number Diff line number Diff line change
@@ -175,7 +175,7 @@ type OrgVdcNetworkSubnetIPRanges = ExternalNetworkV2IPRanges
// OrgVdcNetworkSubnetIPRangeValues is a type alias to reuse the same definitions with appropriate names
type OrgVdcNetworkSubnetIPRangeValues = ExternalNetworkV2IPRange

//OrgVdcNetworkSubnets
// OrgVdcNetworkSubnets
type OrgVdcNetworkSubnets struct {
Values []OrgVdcNetworkSubnetValues `json:"values"`
}
16 changes: 8 additions & 8 deletions types/v56/nsxv_types.go
Original file line number Diff line number Diff line change
@@ -7,12 +7,12 @@ package types
import "encoding/xml"

// FirewallConfigWithXml allows to enable/disable firewall on a specific edge gateway
// Reference: vCloud Director API for NSX Programming Guide
// Reference: VMware Cloud Director API for NSX Programming Guide
// https://code.vmware.com/docs/6900/vcloud-director-api-for-nsx-programming-guide
//
// Warning. It nests all firewall rules because Edge Gateway API is done so that if this data is not
// sent while enabling it would wipe all firewall rules. InnerXML type field is used with struct tag
//`innerxml` to prevent any manipulation of configuration and sending it verbatim
// `innerxml` to prevent any manipulation of configuration and sending it verbatim
type FirewallConfigWithXml struct {
XMLName xml.Name `xml:"firewall"`
Enabled bool `xml:"enabled"`
@@ -34,7 +34,7 @@ type FirewallDefaultPolicy struct {
}

// LbGeneralParamsWithXml allows to enable/disable load balancing capabilities on specific edge gateway
// Reference: vCloud Director API for NSX Programming Guide
// Reference: VMware Cloud Director API for NSX Programming Guide
// https://code.vmware.com/docs/6900/vcloud-director-api-for-nsx-programming-guide
//
// Warning. It nests all components (LbMonitor, LbPool, LbAppProfile, LbAppRule, LbVirtualServer)
@@ -74,7 +74,7 @@ type InnerXML struct {
}

// LbMonitor defines health check parameters for a particular type of network traffic
// Reference: vCloud Director API for NSX Programming Guide
// Reference: VMware Cloud Director API for NSX Programming Guide
// https://code.vmware.com/docs/6900/vcloud-director-api-for-nsx-programming-guide
type LbMonitor struct {
XMLName xml.Name `xml:"monitor"`
@@ -94,7 +94,7 @@ type LbMonitor struct {

type LbMonitors []LbMonitor

// LbPool represents a load balancer server pool as per "vCloud Director API for NSX Programming Guide"
// LbPool represents a load balancer server pool as per "VMware Cloud Director API for NSX Programming Guide"
// Type: LBPoolHealthCheckType
// https://code.vmware.com/docs/6900/vcloud-director-api-for-nsx-programming-guide
type LbPool struct {
@@ -126,7 +126,7 @@ type LbPoolMember struct {

type LbPoolMembers []LbPoolMember

// LbAppProfile represents a load balancer application profile as per "vCloud Director API for NSX
// LbAppProfile represents a load balancer application profile as per "VMware Cloud Director API for NSX
// Programming Guide"
// https://code.vmware.com/docs/6900/vcloud-director-api-for-nsx-programming-guide
type LbAppProfile struct {
@@ -158,7 +158,7 @@ type LbAppProfileHttpRedirect struct {
To string `xml:"to,omitempty"`
}

// LbAppRule represents a load balancer application rule as per "vCloud Director API for NSX
// LbAppRule represents a load balancer application rule as per "VMware Cloud Director API for NSX
// Programming Guide"
// https://code.vmware.com/docs/6900/vcloud-director-api-for-nsx-programming-guide
type LbAppRule struct {
@@ -170,7 +170,7 @@ type LbAppRule struct {

type LbAppRules []LbAppRule

// LbVirtualServer represents a load balancer virtual server as per "vCloud Director API for NSX
// LbVirtualServer represents a load balancer virtual server as per "VMware Cloud Director API for NSX
// Programming Guide"
// https://code.vmware.com/docs/6900/vcloud-director-api-for-nsx-programming-guide
type LbVirtualServer struct {
42 changes: 21 additions & 21 deletions types/v56/types.go
Original file line number Diff line number Diff line change
@@ -556,10 +556,10 @@ type VdcConfiguration struct {
IncludeMemoryOverhead *bool `xml:"IncludeMemoryOverhead,omitempty"` // Supported from 32.0 for the Flex model
}

// Task represents an asynchronous operation in vCloud Director.
// Task represents an asynchronous operation in VMware Cloud Director.
// Type: TaskType
// Namespace: http://www.vmware.com/vcloud/v1.5
// Description: Represents an asynchronous operation in vCloud Director.
// Description: Represents an asynchronous operation in VMware Cloud Director.
// Since: 0.9
// Comments added from https://code.vmware.com/apis/912/vmware-cloud-director/doc/doc/types/TaskType.html
type Task struct {
@@ -685,17 +685,17 @@ type Link struct {
// OrgList represents a lists of Organizations
// Type: OrgType
// Namespace: http://www.vmware.com/vcloud/v1.5
// Description: Represents a list of vCloud Director organizations.
// Description: Represents a list of VMware Cloud Director organizations.
// Since: 0.9
type OrgList struct {
Link LinkList `xml:"Link,omitempty"`
Org []*Org `xml:"Org,omitempty"`
}

// Org represents the user view of a vCloud Director organization.
// Org represents the user view of a VMware Cloud Director organization.
// Type: OrgType
// Namespace: http://www.vmware.com/vcloud/v1.5
// Description: Represents the user view of a vCloud Director organization.
// Description: Represents the user view of a VMware Cloud Director organization.
// Since: 0.9
type Org struct {
HREF string `xml:"href,attr,omitempty"`
@@ -730,10 +730,10 @@ type RightsType struct {
RightReference []*Reference `xml:"RightReference,omitempty"`
}

// AdminOrg represents the admin view of a vCloud Director organization.
// AdminOrg represents the admin view of a VMware Cloud Director organization.
// Type: AdminOrgType
// Namespace: http://www.vmware.com/vcloud/v1.5
// Description: Represents the admin view of a vCloud Director organization.
// Description: Represents the admin view of a VMware Cloud Director organization.
// Since: 0.9
type AdminOrg struct {
XMLName xml.Name `xml:"AdminOrg"`
@@ -758,10 +758,10 @@ type AdminOrg struct {
RoleReferences *OrgRoleType `xml:"RoleReferences,omitempty"`
}

// OrgSettingsType represents the settings for a vCloud Director organization.
// OrgSettingsType represents the settings for a VMware Cloud Director organization.
// Type: OrgSettingsType
// Namespace: http://www.vmware.com/vcloud/v1.5
// Description: Represents the settings of a vCloud Director organization.
// Description: Represents the settings of a VMware Cloud Director organization.
// Since: 0.9
type OrgSettings struct {
//attributes
@@ -776,10 +776,10 @@ type OrgSettings struct {

}

// OrgGeneralSettingsType represents the general settings for a vCloud Director organization.
// OrgGeneralSettingsType represents the general settings for a VMware Cloud Director organization.
// Type: OrgGeneralSettingsType
// Namespace: http://www.vmware.com/vcloud/v1.5
// Description: Represents the user view of a vCloud Director organization.
// Description: Represents the user view of a VMware Cloud Director organization.
// Since: 0.9
type OrgGeneralSettings struct {
HREF string `xml:"href,attr,omitempty"` // The URI of the entity.
@@ -795,10 +795,10 @@ type OrgGeneralSettings struct {
DelayAfterPowerOnSeconds int `xml:"DelayAfterPowerOnSeconds,omitempty"`
}

// VAppTemplateLeaseSettings represents the vapp template lease settings for a vCloud Director organization.
// VAppTemplateLeaseSettings represents the vapp template lease settings for a VMware Cloud Director organization.
// Type: VAppTemplateLeaseSettingsType
// Namespace: http://www.vmware.com/vcloud/v1.5
// Description: Represents the vapp template lease settings of a vCloud Director organization.
// Description: Represents the vapp template lease settings of a VMware Cloud Director organization.
// Since: 0.9
type VAppTemplateLeaseSettings struct {
HREF string `xml:"href,attr,omitempty"` // The URI of the entity.
@@ -828,10 +828,10 @@ type OrgFederationSettings struct {
Enabled bool `xml:"Enabled,omitempty"`
}

// OrgLdapSettingsType represents the ldap settings for a vCloud Director organization.
// OrgLdapSettingsType represents the ldap settings for a VMware Cloud Director organization.
// Type: OrgLdapSettingsType
// Namespace: http://www.vmware.com/vcloud/v1.5
// Description: Represents the ldap settings of a vCloud Director organization.
// Description: Represents the ldap settings of a VMware Cloud Director organization.
// Since: 0.9
type OrgLdapSettingsType struct {
XMLName xml.Name `xml:"OrgLdapSettings"`
@@ -845,10 +845,10 @@ type OrgLdapSettingsType struct {
CustomOrgLdapSettings *CustomOrgLdapSettings `xml:"CustomOrgLdapSettings,omitempty"` // Needs to be set if user chooses custom mode
}

// CustomOrgLdapSettings represents the custom ldap settings for a vCloud Director organization.
// CustomOrgLdapSettings represents the custom ldap settings for a VMware Cloud Director organization.
// Type: CustomOrgLdapSettingsType
// Namespace: http://www.vmware.com/vcloud/v1.5
// Description: Represents the custom ldap settings of a vCloud Director organization.
// Description: Represents the custom ldap settings of a VMware Cloud Director organization.
// Since: 0.9
// Note. Order of these fields matter and API will error if it is changed
type CustomOrgLdapSettings struct {
@@ -874,10 +874,10 @@ type CustomOrgLdapSettings struct {
Realm string `xml:"Realm,omitempty"`
}

// OrgLdapGroupAttributes represents the ldap group attribute settings for a vCloud Director organization.
// OrgLdapGroupAttributes represents the ldap group attribute settings for a VMware Cloud Director organization.
// Type: OrgLdapGroupAttributesType
// Namespace: http://www.vmware.com/vcloud/v1.5
// Description: Represents the ldap group attribute settings of a vCloud Director organization.
// Description: Represents the ldap group attribute settings of a VMware Cloud Director organization.
// Since: 0.9
// Note. Order of these fields matter and API will error if it is changed
type OrgLdapGroupAttributes struct {
@@ -889,10 +889,10 @@ type OrgLdapGroupAttributes struct {
MembershipIdentifier string `xml:"MembershipIdentifier"`
}

// OrgLdapUserAttributesType represents the ldap user attribute settings for a vCloud Director organization.
// OrgLdapUserAttributesType represents the ldap user attribute settings for a VMware Cloud Director organization.
// Type: OrgLdapUserAttributesType
// Namespace: http://www.vmware.com/vcloud/v1.5
// Description: Represents the ldap user attribute settings of a vCloud Director organization.
// Description: Represents the ldap user attribute settings of a VMware Cloud Director organization.
// Since: 0.9
// Note. Order of these fields matter and API will error if it is changed.
type OrgLdapUserAttributes struct {
6 changes: 3 additions & 3 deletions util/logging.go
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ package util

import (
"fmt"
"io/ioutil"
"io"
"log"
"net/http"
"os"
@@ -49,7 +49,7 @@ const (
)

var (
// All go-vcloud director logging goes through this logger
// All go-vcloud-director logging goes through this logger
Logger *log.Logger

// It's true if we're using an user provided logger
@@ -137,7 +137,7 @@ func SetLog() {
return
}
if !EnableLogging {
Logger = log.New(ioutil.Discard, "", log.Ldate|log.Ltime)
Logger = log.New(io.Discard, "", log.Ldate|log.Ltime)
return
}

3 changes: 1 addition & 2 deletions util/tar.go
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ import (
"archive/tar"
"errors"
"io"
"io/ioutil"
"net/http"
"os"
"path/filepath"
@@ -32,7 +31,7 @@ func Unpack(tarFile string) ([]string, string, error) {

tarReader := tar.NewReader(reader)

dst, err = ioutil.TempDir("", TmpDirPrefix)
dst, err = os.MkdirTemp("", TmpDirPrefix)
if err != nil {
return filePaths, dst, err
}