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

Change tag to *string on update reqs #222

Merged
merged 2 commits into from
May 17, 2022
Merged

Conversation

optik-aper
Copy link
Member

@optik-aper optik-aper commented May 13, 2022

Description

Change the update req structs so that tag can be deleted by sending an empty string. Previously empty was ignored.

Related Issues

#221

Checklist:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you linted your code locally prior to submission?
  • Have you successfully ran tests with your changes locally?

@optik-aper optik-aper added the enhancement New feature or request label May 13, 2022
@optik-aper optik-aper requested a review from ddymko May 13, 2022 15:28
@github-actions
Copy link

Unit Tests and Coverage

Show Output
=== RUN   TestAccountServiceHandler_Get
--- PASS: TestAccountServiceHandler_Get (0.00s)
=== RUN   TestApplicationServiceHandler_List
--- PASS: TestApplicationServiceHandler_List (0.00s)
=== RUN   TestBackupServiceHandler_List
--- PASS: TestBackupServiceHandler_List (0.00s)
=== RUN   TestBackupServiceHandler_ListEmpty
--- PASS: TestBackupServiceHandler_ListEmpty (0.00s)
=== RUN   TestBackupServiceHandler_Get
--- PASS: TestBackupServiceHandler_Get (0.00s)
=== RUN   TestBackupServiceHandler_GetEmpty
--- PASS: TestBackupServiceHandler_GetEmpty (0.00s)
=== RUN   TestBareMetalServerServiceHandler_GetServer
--- PASS: TestBareMetalServerServiceHandler_GetServer (0.00s)
=== RUN   TestBareMetalServerServiceHandler_Create
--- PASS: TestBareMetalServerServiceHandler_Create (0.00s)
=== RUN   TestBareMetalServerServiceHandler_Update
--- PASS: TestBareMetalServerServiceHandler_Update (0.00s)
=== RUN   TestBareMetalServerServiceHandler_Delete
--- PASS: TestBareMetalServerServiceHandler_Delete (0.00s)
=== RUN   TestBareMetalServerServiceHandler_List
--- PASS: TestBareMetalServerServiceHandler_List (0.00s)
=== RUN   TestBareMetalServerServiceHandler_GetBandwidth
--- PASS: TestBareMetalServerServiceHandler_GetBandwidth (0.00s)
=== RUN   TestBareMetalServerServiceHandler_Halt
--- PASS: TestBareMetalServerServiceHandler_Halt (0.00s)
=== RUN   TestBareMetalServerServiceHandler_ListIPv4s
--- PASS: TestBareMetalServerServiceHandler_ListIPv4s (0.00s)
=== RUN   TestBareMetalServerServiceHandler_ListIPv6s
--- PASS: TestBareMetalServerServiceHandler_ListIPv6s (0.00s)
=== RUN   TestBareMetalServerServiceHandler_Reboot
--- PASS: TestBareMetalServerServiceHandler_Reboot (0.00s)
=== RUN   TestBareMetalServerServiceHandler_Reinstall
--- PASS: TestBareMetalServerServiceHandler_Reinstall (0.00s)
=== RUN   TestBareMetalServerServiceHandler_Start
--- PASS: TestBareMetalServerServiceHandler_Start (0.00s)
=== RUN   TestBareMetalServerServiceHandler_GetUserData
--- PASS: TestBareMetalServerServiceHandler_GetUserData (0.00s)
=== RUN   TestBareMetalServerServiceHandler_GetUpgrades
--- PASS: TestBareMetalServerServiceHandler_GetUpgrades (0.00s)
=== RUN   TestBareMetalServerServiceHandler_GetVNCUrl
--- PASS: TestBareMetalServerServiceHandler_GetVNCUrl (0.00s)
=== RUN   TestBareMetalServerServiceHandler_MassStart
--- PASS: TestBareMetalServerServiceHandler_MassStart (0.00s)
=== RUN   TestBareMetalServerServiceHandler_MassReboot
--- PASS: TestBareMetalServerServiceHandler_MassReboot (0.00s)
=== RUN   TestBareMetalServerServiceHandler_MassHalt
--- PASS: TestBareMetalServerServiceHandler_MassHalt (0.00s)
=== RUN   TestBareMetalServerServiceHandler_CreateMarketplaceImage
--- PASS: TestBareMetalServerServiceHandler_CreateMarketplaceImage (0.00s)
=== RUN   TestBillingServiceHandler_ListHistory
--- PASS: TestBillingServiceHandler_ListHistory (0.00s)
=== RUN   TestBillingServiceHandler_ListInvoices
--- PASS: TestBillingServiceHandler_ListInvoices (0.00s)
=== RUN   TestBillingServiceHandler_ListHistoryEmpty
--- PASS: TestBillingServiceHandler_ListHistoryEmpty (0.00s)
=== RUN   TestBillingServiceHandler_ListInvoicesEmpty
--- PASS: TestBillingServiceHandler_ListInvoicesEmpty (0.00s)
=== RUN   TestBillingServiceHandler_GetInvoice
--- PASS: TestBillingServiceHandler_GetInvoice (0.00s)
=== RUN   TestBillingServiceHandler_ListInvoiceItems
--- PASS: TestBillingServiceHandler_ListInvoiceItems (0.00s)
=== RUN   TestBlockStorageServiceHandler_Create
--- PASS: TestBlockStorageServiceHandler_Create (0.00s)
=== RUN   TestBlockStorageServiceHandler_Get
--- PASS: TestBlockStorageServiceHandler_Get (0.00s)
=== RUN   TestBlockStorageServiceHandler_Update
--- PASS: TestBlockStorageServiceHandler_Update (0.00s)
=== RUN   TestBlockStorageServiceHandler_Delete
--- PASS: TestBlockStorageServiceHandler_Delete (0.00s)
=== RUN   TestBlockStorageServiceHandler_List
--- PASS: TestBlockStorageServiceHandler_List (0.00s)
=== RUN   TestBlockStorageServiceHandler_Attach
--- PASS: TestBlockStorageServiceHandler_Attach (0.00s)
=== RUN   TestBlockStorageServiceHandler_Detach
--- PASS: TestBlockStorageServiceHandler_Detach (0.00s)
=== RUN   TestDomainRecordsServiceHandler_Create
--- PASS: TestDomainRecordsServiceHandler_Create (0.00s)
=== RUN   TestDomainRecordsServiceHandler_Get
--- PASS: TestDomainRecordsServiceHandler_Get (0.00s)
=== RUN   TestDomainRecordsServiceHandler_Update
--- PASS: TestDomainRecordsServiceHandler_Update (0.00s)
=== RUN   TestDomainRecordsServiceHandler_Delete
--- PASS: TestDomainRecordsServiceHandler_Delete (0.00s)
=== RUN   TestDomainRecordsServiceHandler_List
--- PASS: TestDomainRecordsServiceHandler_List (0.00s)
=== RUN   TestDomainServiceHandler_Create
--- PASS: TestDomainServiceHandler_Create (0.00s)
=== RUN   TestDomainServiceHandler_Get
--- PASS: TestDomainServiceHandler_Get (0.00s)
=== RUN   TestDomainServiceHandler_Update
--- PASS: TestDomainServiceHandler_Update (0.00s)
=== RUN   TestDomainServiceHandler_Delete
--- PASS: TestDomainServiceHandler_Delete (0.00s)
=== RUN   TestDNSDomainServiceHandler_List
--- PASS: TestDNSDomainServiceHandler_List (0.00s)
=== RUN   TestDomainServiceHandler_GetSoa
--- PASS: TestDomainServiceHandler_GetSoa (0.00s)
=== RUN   TestDNSDomainServiceHandler_UpdateSoa
--- PASS: TestDNSDomainServiceHandler_UpdateSoa (0.00s)
=== RUN   TestDNSDomainServiceHandler_DNSSecInfo
--- PASS: TestDNSDomainServiceHandler_DNSSecInfo (0.00s)
=== RUN   TestFireWallGroupServiceHandler_Create
--- PASS: TestFireWallGroupServiceHandler_Create (0.00s)
=== RUN   TestFireWallGroupServiceHandler_Get
--- PASS: TestFireWallGroupServiceHandler_Get (0.00s)
=== RUN   TestFireWallGroupServiceHandler_ChangeDescription
--- PASS: TestFireWallGroupServiceHandler_ChangeDescription (0.00s)
=== RUN   TestFireWallGroupServiceHandler_Delete
--- PASS: TestFireWallGroupServiceHandler_Delete (0.00s)
=== RUN   TestFireWallGroupServiceHandler_List
--- PASS: TestFireWallGroupServiceHandler_List (0.00s)
=== RUN   TestFireWallRuleServiceHandler_Create
--- PASS: TestFireWallRuleServiceHandler_Create (0.00s)
=== RUN   TestFireWallRuleServiceHandler_Delete
--- PASS: TestFireWallRuleServiceHandler_Delete (0.00s)
=== RUN   TestFireWallRuleServiceHandler_List
--- PASS: TestFireWallRuleServiceHandler_List (0.00s)
=== RUN   TestFireWallRuleServiceHandler_Get
--- PASS: TestFireWallRuleServiceHandler_Get (0.00s)
=== RUN   TestNewClient
--- PASS: TestNewClient (0.00s)
=== RUN   TestClient_DoWithContext
--- PASS: TestClient_DoWithContext (0.00s)
=== RUN   TestClient_DoWithContextFailure
--- PASS: TestClient_DoWithContextFailure (1.34s)
=== RUN   TestClient_DoWithContextError
--- PASS: TestClient_DoWithContextError (1.34s)
=== RUN   TestClient_NewRequest
--- PASS: TestClient_NewRequest (0.00s)
=== RUN   TestClient_SetBaseUrl
--- PASS: TestClient_SetBaseUrl (0.00s)
=== RUN   TestClient_SetUserAgent
--- PASS: TestClient_SetUserAgent (0.00s)
=== RUN   TestClient_SetRateLimit
--- PASS: TestClient_SetRateLimit (0.00s)
=== RUN   TestClient_OnRequestCompleted
--- PASS: TestClient_OnRequestCompleted (0.00s)
=== RUN   TestClient_SetRetryLimit
--- PASS: TestClient_SetRetryLimit (0.00s)
=== RUN   TestNewRequest_badURI
--- PASS: TestNewRequest_badURI (0.00s)
=== RUN   TestNewRequest_badBody
--- PASS: TestNewRequest_badBody (0.00s)
=== RUN   TestRequest_InvalidCall
--- PASS: TestRequest_InvalidCall (0.00s)
=== RUN   TestRequest_InvalidResponseBody
--- PASS: TestRequest_InvalidResponseBody (0.00s)
=== RUN   TestServerServiceHandler_GetBackupSchedule
--- PASS: TestServerServiceHandler_GetBackupSchedule (0.00s)
=== RUN   TestServerServiceHandler_SetBackupSchedule
--- PASS: TestServerServiceHandler_SetBackupSchedule (0.00s)
=== RUN   TestServerServiceHandler_RestoreBackup
--- PASS: TestServerServiceHandler_RestoreBackup (0.00s)
=== RUN   TestServerServiceHandler_RestoreSnapshot
--- PASS: TestServerServiceHandler_RestoreSnapshot (0.00s)
=== RUN   TestServerServiceHandler_Neighbors
--- PASS: TestServerServiceHandler_Neighbors (0.00s)
=== RUN   TestServerServiceHandler_ListPrivateNetworks
--- PASS: TestServerServiceHandler_ListPrivateNetworks (0.00s)
=== RUN   TestServerServiceHandler_ListVPCInfo
--- PASS: TestServerServiceHandler_ListVPCInfo (0.00s)
=== RUN   TestServerServiceHandler_GetUserData
--- PASS: TestServerServiceHandler_GetUserData (0.00s)
=== RUN   TestServerServiceHandler_ListIPv4
--- PASS: TestServerServiceHandler_ListIPv4 (0.00s)
=== RUN   TestServerServiceHandler_ListIPv6
--- PASS: TestServerServiceHandler_ListIPv6 (0.00s)
=== RUN   TestServerServiceHandler_CreateIPv4
--- PASS: TestServerServiceHandler_CreateIPv4 (0.00s)
=== RUN   TestServerServiceHandler_DestroyIPV4
--- PASS: TestServerServiceHandler_DestroyIPV4 (0.00s)
=== RUN   TestServerServiceHandler_GetBandwidth
--- PASS: TestServerServiceHandler_GetBandwidth (0.00s)
=== RUN   TestServerServiceHandler_ListReverseIPv6
--- PASS: TestServerServiceHandler_ListReverseIPv6 (0.00s)
=== RUN   TestServerServiceHandler_DefaultReverseIPv4
--- PASS: TestServerServiceHandler_DefaultReverseIPv4 (0.00s)
=== RUN   TestServerServiceHandler_DeleteReverseIPv6
--- PASS: TestServerServiceHandler_DeleteReverseIPv6 (0.00s)
=== RUN   TestServerServiceHandler_CreateReverseIPv4
--- PASS: TestServerServiceHandler_CreateReverseIPv4 (0.00s)
=== RUN   TestServerServiceHandler_CreateReverseIPv6
--- PASS: TestServerServiceHandler_CreateReverseIPv6 (0.00s)
=== RUN   TestServerServiceHandler_Halt
--- PASS: TestServerServiceHandler_Halt (0.00s)
=== RUN   TestServerServiceHandler_Start
--- PASS: TestServerServiceHandler_Start (0.00s)
=== RUN   TestServerServiceHandler_Reboot
--- PASS: TestServerServiceHandler_Reboot (0.00s)
=== RUN   TestServerServiceHandler_Reinstall
--- PASS: TestServerServiceHandler_Reinstall (0.00s)
=== RUN   TestServerServiceHandler_Delete
--- PASS: TestServerServiceHandler_Delete (0.00s)
=== RUN   TestServerServiceHandler_Create
--- PASS: TestServerServiceHandler_Create (0.00s)
=== RUN   TestServerServiceHandler_List
--- PASS: TestServerServiceHandler_List (0.00s)
=== RUN   TestServerServiceHandler_GetServer
--- PASS: TestServerServiceHandler_GetServer (0.00s)
=== RUN   TestInstanceServiceHandler_GetUpgrades
--- PASS: TestInstanceServiceHandler_GetUpgrades (0.00s)
=== RUN   TestServerServiceHandler_MassStart
--- PASS: TestServerServiceHandler_MassStart (0.00s)
=== RUN   TestServerServiceHandler_MassReboot
--- PASS: TestServerServiceHandler_MassReboot (0.00s)
=== RUN   TestServerServiceHandler_MassHalt
--- PASS: TestServerServiceHandler_MassHalt (0.00s)
=== RUN   TestServerServiceHandler_AttachPrivateNetwork
--- PASS: TestServerServiceHandler_AttachPrivateNetwork (0.00s)
=== RUN   TestServerServiceHandler_DetachPrivateNetwork
--- PASS: TestServerServiceHandler_DetachPrivateNetwork (0.00s)
=== RUN   TestServerServiceHandler_AttachVPC
--- PASS: TestServerServiceHandler_AttachVPC (0.00s)
=== RUN   TestServerServiceHandler_DetachVPC
--- PASS: TestServerServiceHandler_DetachVPC (0.00s)
=== RUN   TestServerServiceHandler_ISOAttach
--- PASS: TestServerServiceHandler_ISOAttach (0.00s)
=== RUN   TestServerServiceHandler_ISODetach
--- PASS: TestServerServiceHandler_ISODetach (0.00s)
=== RUN   TestServerServiceHandler_ISO
--- PASS: TestServerServiceHandler_ISO (0.00s)
=== RUN   TestServerServiceHandler_Update
--- PASS: TestServerServiceHandler_Update (0.00s)
=== RUN   TestServerServiceHandler_CreateMarketplace
--- PASS: TestServerServiceHandler_CreateMarketplace (0.00s)
=== RUN   TestIsoServiceHandler_Create
--- PASS: TestIsoServiceHandler_Create (0.00s)
=== RUN   TestIsoServiceHandler_Get
--- PASS: TestIsoServiceHandler_Get (0.00s)
=== RUN   TestIsoServiceHandler_Delete
--- PASS: TestIsoServiceHandler_Delete (0.00s)
=== RUN   TestIsoServiceHandler_List
--- PASS: TestIsoServiceHandler_List (0.00s)
=== RUN   TestIsoServiceHandler_ListPublic
--- PASS: TestIsoServiceHandler_ListPublic (0.00s)
=== RUN   TestKubernetesHandler_CreateCluster
--- PASS: TestKubernetesHandler_CreateCluster (0.00s)
=== RUN   TestKubernetesHandler_GetCluster
--- PASS: TestKubernetesHandler_GetCluster (0.00s)
=== RUN   TestKubernetesHandler_ListClusters
--- PASS: TestKubernetesHandler_ListClusters (0.00s)
=== RUN   TestKubernetesHandler_UpdateCluster
--- PASS: TestKubernetesHandler_UpdateCluster (0.00s)
=== RUN   TestKubernetesHandler_DeleteCluster
--- PASS: TestKubernetesHandler_DeleteCluster (0.00s)
=== RUN   TestKubernetesHandler_DeleteClusterWithResources
--- PASS: TestKubernetesHandler_DeleteClusterWithResources (0.00s)
=== RUN   TestKubernetesHandler_CreateNodePool
--- PASS: TestKubernetesHandler_CreateNodePool (0.00s)
=== RUN   TestKubernetesHandler_GetNodePool
--- PASS: TestKubernetesHandler_GetNodePool (0.00s)
=== RUN   TestKubernetesHandler_ListNodePools
--- PASS: TestKubernetesHandler_ListNodePools (0.00s)
=== RUN   TestKubernetesHandler_UpdateNodePool
--- PASS: TestKubernetesHandler_UpdateNodePool (0.00s)
=== RUN   TestKubernetesHandler_DeleteNodePool
--- PASS: TestKubernetesHandler_DeleteNodePool (0.00s)
=== RUN   TestKubernetesHandler_DeleteNodePoolInstance
--- PASS: TestKubernetesHandler_DeleteNodePoolInstance (0.00s)
=== RUN   TestKubernetesHandler_RecycleNodePoolInstance
--- PASS: TestKubernetesHandler_RecycleNodePoolInstance (0.00s)
=== RUN   TestKubernetesHandler_GetKubeConfig
--- PASS: TestKubernetesHandler_GetKubeConfig (0.00s)
=== RUN   TestKubernetesHandler_GetVersions
--- PASS: TestKubernetesHandler_GetVersions (0.00s)
=== RUN   TestKubernetesHandler_GetUpgrades
--- PASS: TestKubernetesHandler_GetUpgrades (0.00s)
=== RUN   TestKubernetesHandler_Upgrade
--- PASS: TestKubernetesHandler_Upgrade (0.00s)
=== RUN   TestLoadBalancerHandler_List
--- PASS: TestLoadBalancerHandler_List (0.00s)
=== RUN   TestLoadBalancerHandler_Delete
--- PASS: TestLoadBalancerHandler_Delete (0.00s)
=== RUN   TestLoadBalancerHandler_Get
--- PASS: TestLoadBalancerHandler_Get (0.00s)
=== RUN   TestLoadBalancerHandler_ListForwardingRules
--- PASS: TestLoadBalancerHandler_ListForwardingRules (0.00s)
=== RUN   TestLoadBalancerHandler_DeleteForwardingRule
--- PASS: TestLoadBalancerHandler_DeleteForwardingRule (0.00s)
=== RUN   TestLoadBalancerHandler_CreateForwardingRule
--- PASS: TestLoadBalancerHandler_CreateForwardingRule (0.00s)
=== RUN   TestLoadBalancerHandler_Create
--- PASS: TestLoadBalancerHandler_Create (0.00s)
=== RUN   TestLoadBalancerHandler_Update
--- PASS: TestLoadBalancerHandler_Update (0.00s)
=== RUN   TestLoadBalancerHandler_GetFowardingRule
--- PASS: TestLoadBalancerHandler_GetFowardingRule (0.00s)
=== RUN   TestLoadBalancerHandler_GetFirewallRule
--- PASS: TestLoadBalancerHandler_GetFirewallRule (0.00s)
=== RUN   TestMeta
--- PASS: TestMeta (0.00s)
=== RUN   TestNetworkServiceHandler_Create
--- PASS: TestNetworkServiceHandler_Create (0.00s)
=== RUN   TestNetworkServiceHandler_Delete
--- PASS: TestNetworkServiceHandler_Delete (0.00s)
=== RUN   TestNetworkServiceHandler_List
--- PASS: TestNetworkServiceHandler_List (0.00s)
=== RUN   TestNetworkServiceHandler_Update
--- PASS: TestNetworkServiceHandler_Update (0.00s)
=== RUN   TestNetworkServiceHandler_Get
--- PASS: TestNetworkServiceHandler_Get (0.00s)
=== RUN   TestObjectStorageServiceHandler_Create
--- PASS: TestObjectStorageServiceHandler_Create (0.00s)
=== RUN   TestObjectStorageServiceHandler_Get
--- PASS: TestObjectStorageServiceHandler_Get (0.00s)
=== RUN   TestObjectStorageServiceHandler_Update
--- PASS: TestObjectStorageServiceHandler_Update (0.00s)
=== RUN   TestObjectStorageServiceHandler_Delete
--- PASS: TestObjectStorageServiceHandler_Delete (0.00s)
=== RUN   TestObjectStorageServiceHandler_List
--- PASS: TestObjectStorageServiceHandler_List (0.00s)
=== RUN   TestObjectStorageServiceHandler_ListCluster
--- PASS: TestObjectStorageServiceHandler_ListCluster (0.00s)
=== RUN   TestObjectStorageServiceHandler_RegenerateKeys
--- PASS: TestObjectStorageServiceHandler_RegenerateKeys (0.00s)
=== RUN   TestOSServiceHandler_List
--- PASS: TestOSServiceHandler_List (0.00s)
=== RUN   TestPlanServiceHandler_List
--- PASS: TestPlanServiceHandler_List (0.00s)
=== RUN   TestPlanServiceHandler_GetBareMetalList
--- PASS: TestPlanServiceHandler_GetBareMetalList (0.00s)
=== RUN   TestRegionServiceHandler_List
--- PASS: TestRegionServiceHandler_List (0.00s)
=== RUN   TestRegionServiceHandler_Availability
--- PASS: TestRegionServiceHandler_Availability (0.00s)
=== RUN   TestReservedIPServiceHandler_Attach
--- PASS: TestReservedIPServiceHandler_Attach (0.00s)
=== RUN   TestReservedIPServiceHandler_Convert
--- PASS: TestReservedIPServiceHandler_Convert (0.00s)
=== RUN   TestReservedIPServiceHandler_Create
--- PASS: TestReservedIPServiceHandler_Create (0.00s)
=== RUN   TestReservedIPServiceHandler_Delete
--- PASS: TestReservedIPServiceHandler_Delete (0.00s)
=== RUN   TestReservedIPServiceHandler_Detach
--- PASS: TestReservedIPServiceHandler_Detach (0.00s)
=== RUN   TestReservedIPServiceHandler_Get
--- PASS: TestReservedIPServiceHandler_Get (0.00s)
=== RUN   TestReservedIPServiceHandler_List
--- PASS: TestReservedIPServiceHandler_List (0.00s)
=== RUN   TestSnapshotServiceHandler_Create
--- PASS: TestSnapshotServiceHandler_Create (0.00s)
=== RUN   TestSnapshotServiceHandler_CreateFromURL
--- PASS: TestSnapshotServiceHandler_CreateFromURL (0.00s)
=== RUN   TestSnapshotServiceHandler_Get
--- PASS: TestSnapshotServiceHandler_Get (0.00s)
=== RUN   TestSnapshotServiceHandler_Delete
--- PASS: TestSnapshotServiceHandler_Delete (0.00s)
=== RUN   TestSnapshotServiceHandler_List
--- PASS: TestSnapshotServiceHandler_List (0.00s)
=== RUN   TestSSHKeyServiceHandler_Create
--- PASS: TestSSHKeyServiceHandler_Create (0.00s)
=== RUN   TestSSHKeyServiceHandler_Get
--- PASS: TestSSHKeyServiceHandler_Get (0.00s)
=== RUN   TestSSHKeyServiceHandler_Update
--- PASS: TestSSHKeyServiceHandler_Update (0.00s)
=== RUN   TestSSHKeyServiceHandler_Delete
--- PASS: TestSSHKeyServiceHandler_Delete (0.00s)
=== RUN   TestSSHKeyServiceHandler_List
--- PASS: TestSSHKeyServiceHandler_List (0.00s)
=== RUN   TestStartupScriptServiceHandler_Create
--- PASS: TestStartupScriptServiceHandler_Create (0.00s)
=== RUN   TestStartupScriptServiceHandler_GET
--- PASS: TestStartupScriptServiceHandler_GET (0.00s)
=== RUN   TestStartupScriptServiceHandler_Update
--- PASS: TestStartupScriptServiceHandler_Update (0.00s)
=== RUN   TestStartupScriptServiceHandler_Delete
--- PASS: TestStartupScriptServiceHandler_Delete (0.00s)
=== RUN   TestStartupScriptServiceHandler_List
--- PASS: TestStartupScriptServiceHandler_List (0.00s)
=== RUN   TestUserServiceHandler_Create
--- PASS: TestUserServiceHandler_Create (0.00s)
=== RUN   TestUserServiceHandler_Delete
--- PASS: TestUserServiceHandler_Delete (0.00s)
=== RUN   TestUserServiceHandler_List
--- PASS: TestUserServiceHandler_List (0.00s)
=== RUN   TestUserServiceHandler_Update
--- PASS: TestUserServiceHandler_Update (0.00s)
=== RUN   TestUserServiceHandler_Get
--- PASS: TestUserServiceHandler_Get (0.00s)
=== RUN   TestVPCServiceHandler_Create
--- PASS: TestVPCServiceHandler_Create (0.00s)
=== RUN   TestVPCServiceHandler_Delete
--- PASS: TestVPCServiceHandler_Delete (0.00s)
=== RUN   TestVPCServiceHandler_List
--- PASS: TestVPCServiceHandler_List (0.00s)
=== RUN   TestVPCServiceHandler_Update
--- PASS: TestVPCServiceHandler_Update (0.00s)
=== RUN   TestVPCServiceHandler_Get
--- PASS: TestVPCServiceHandler_Get (0.00s)
PASS
coverage: 77.0% of statements
ok  	github.com/vultr/govultr/v2	2.742s

Pusher: @optik-aper, Action: pull_request_target

@optik-aper
Copy link
Member Author

Testing

Instance

  • Create an instance:

    func instCreate(client *govultr.Client, ctx context.Context) {
        inst, err := client.Instance.Create(ctx, &govultr.InstanceCreateReq{
      	  Region: "ewr",
      	  Plan:   "vc2-1c-1gb",
      	  Label:  "inst-z1",
      	  OsID:   244,
        })
        if err != nil {
      	  fmt.Println(err)
      	  panic(err.Error())
        }
    
        fmt.Println(inst)
    }
    
  • Add a Tag to the instance as a *string:

    func instUpdate(client *govultr.Client, ctx context.Context) {
    
        instID := "<UUID>"
    
        inst, err := client.Instance.Update(ctx, instID, &govultr.InstanceUpdateReq{
      	  Tag: govultr.StringToStringPtr("test2"),
        })
    
        if err != nil {
      	  fmt.Println(err)
      	  panic(err.Error())
        }
    
        fmt.Println(inst)
    }
    
  • Check the output for the new tag

  • Clear out Tag by sending an empty *string:

    func instUpdate(client *govultr.Client, ctx context.Context) {
    
        instID := "<UUID>"
    
        inst, err := client.Instance.Update(ctx, instID, &govultr.InstanceUpdateReq{
      	  Tag: govultr.StringToStringPtr(""),
        })
    
        if err != nil {
      	  fmt.Println(err)
      	  panic(err.Error())
        }
    
        fmt.Println(inst)
    }
    
  • Check again and make sure tag is blank

Bare Metal

  • Create a server:

    func bmCreate(client *govultr.Client, ctx context.Context) {
        bm, err := client.BareMetalServer.Create(ctx, &govultr.BareMetalCreate{
      	  Region: "lax",
      	  Plan:   "vbm-4c-32gb",
      	  Label:  "bm-x1",
      	  OsID:   477,
        })
    
        if err != nil {
      	  fmt.Println(err)
      	  panic(err.Error())
        }
    
        fmt.Println(bm)
    }
    
  • Add a Tag to the server as a *string:

    func bmUpdate(client *govultr.Client, ctx context.Context) {
    
        bmID := "<UUID>"
    
        bm, err := client.BareMetalServer.Update(ctx, bmID, &govultr.BareMetalUpdate{
      	  Tag: govultr.StringToStringPtr("test-tag"),
        })
    
        if err != nil {
      	  fmt.Println(err)
      	  panic(err.Error())
        }
    
        fmt.Println(bm)
    }
    
  • Check for the tag in the output

  • Clear out the Tag by sending an empty *string:

    func bmUpdate(client *govultr.Client, ctx context.Context) {
    
        bmID := "<UUID>"
    
        bm, err := client.BareMetalServer.Update(ctx, bmID, &govultr.BareMetalUpdate{
      	  Tag: govultr.StringToStringPtr(""),
        })
    
        if err != nil {
      	  fmt.Println(err)
      	  panic(err.Error())
        }
    
        fmt.Println(bm)
    }
    
  • Check again and make sure the tag is blank

VKE

  • Create a cluster:

    func vkeClusterCreate(client *govultr.Client, ctx context.Context) {
    
        cluster, err := client.Kubernetes.CreateCluster(ctx, &govultr.ClusterReq{
      	  Region:  "lax",
      	  Label:   "cluster-iv",
      	  Version: "v1.23.5+3",
      	  NodePools: []govultr.NodePoolReq{
      		  {
      			  NodeQuantity: 1,
      			  Plan:         "vc2-2c-4gb",
      			  Label:        "np-i",
      		  },
      	  },
        })
    
        if err != nil {
      	  fmt.Println(err)
      	  panic(err.Error())
        }
    
        fmt.Println(cluster)
    }
    
  • Lookup cluster and node pool UUIDs:

    func vkeClusterGet(client *govultr.Client, ctx context.Context) {
        var clusterID string = "<UUID>"
        cluster, err := client.Kubernetes.GetCluster(ctx, clusterID)
    
        if err != nil {
      	  fmt.Println(err)
      	  panic(err.Error())
        }
    
        fmt.Println(cluster)
    }
    
  • Update the node pool and add a Tag:

    func vkeNodePoolUpdate(client *govultr.Client, ctx context.Context) {
        var clusterID string = "<UUID>"
        var nodePoolID string = "<UUID"
        np, err := client.Kubernetes.UpdateNodePool(ctx, clusterID, nodePoolID, &govultr.NodePoolReqUpdate{
      	  Tag: govultr.StringToStringPtr("test-tag"),
        })
    
        if err != nil {
      	  fmt.Println(err)
      	  panic(err.Error())
        }
    
        fmt.Prinln(np)
    }
    
  • Check the output and make sure the tag exists

  • Clear out the Tag by sending an empty *string:

    func vkeNodePoolUpdate(client *govultr.Client, ctx context.Context) {
        var clusterID string = "<UUID>"
        var nodePoolID string = "<UUID>"
        np, err := client.Kubernetes.UpdateNodePool(ctx, clusterID, nodePoolID, &govultr.NodePoolReqUpdate{
      	  Tag: govultr.StringToStringPtr(""),
        })
    
        if err != nil {
      	  fmt.Println(err)
      	  panic(err.Error())
        }
    
        fmt.Prinln(np)
    }
    
  • Make sure tag is blank in the output

@ddymko
Copy link
Contributor

ddymko commented May 16, 2022

Everything is working expect for VKE - we'll have to update the API to support the behavior. Holding this until the API updates go out

@github-actions
Copy link

Unit Tests and Coverage

Show Output
=== RUN   TestAccountServiceHandler_Get
--- PASS: TestAccountServiceHandler_Get (0.00s)
=== RUN   TestApplicationServiceHandler_List
--- PASS: TestApplicationServiceHandler_List (0.00s)
=== RUN   TestBackupServiceHandler_List
--- PASS: TestBackupServiceHandler_List (0.00s)
=== RUN   TestBackupServiceHandler_ListEmpty
--- PASS: TestBackupServiceHandler_ListEmpty (0.00s)
=== RUN   TestBackupServiceHandler_Get
--- PASS: TestBackupServiceHandler_Get (0.00s)
=== RUN   TestBackupServiceHandler_GetEmpty
--- PASS: TestBackupServiceHandler_GetEmpty (0.00s)
=== RUN   TestBareMetalServerServiceHandler_GetServer
--- PASS: TestBareMetalServerServiceHandler_GetServer (0.00s)
=== RUN   TestBareMetalServerServiceHandler_Create
--- PASS: TestBareMetalServerServiceHandler_Create (0.00s)
=== RUN   TestBareMetalServerServiceHandler_Update
--- PASS: TestBareMetalServerServiceHandler_Update (0.00s)
=== RUN   TestBareMetalServerServiceHandler_Delete
--- PASS: TestBareMetalServerServiceHandler_Delete (0.00s)
=== RUN   TestBareMetalServerServiceHandler_List
--- PASS: TestBareMetalServerServiceHandler_List (0.00s)
=== RUN   TestBareMetalServerServiceHandler_GetBandwidth
--- PASS: TestBareMetalServerServiceHandler_GetBandwidth (0.00s)
=== RUN   TestBareMetalServerServiceHandler_Halt
--- PASS: TestBareMetalServerServiceHandler_Halt (0.00s)
=== RUN   TestBareMetalServerServiceHandler_ListIPv4s
--- PASS: TestBareMetalServerServiceHandler_ListIPv4s (0.00s)
=== RUN   TestBareMetalServerServiceHandler_ListIPv6s
--- PASS: TestBareMetalServerServiceHandler_ListIPv6s (0.00s)
=== RUN   TestBareMetalServerServiceHandler_Reboot
--- PASS: TestBareMetalServerServiceHandler_Reboot (0.00s)
=== RUN   TestBareMetalServerServiceHandler_Reinstall
--- PASS: TestBareMetalServerServiceHandler_Reinstall (0.00s)
=== RUN   TestBareMetalServerServiceHandler_Start
--- PASS: TestBareMetalServerServiceHandler_Start (0.00s)
=== RUN   TestBareMetalServerServiceHandler_GetUserData
--- PASS: TestBareMetalServerServiceHandler_GetUserData (0.00s)
=== RUN   TestBareMetalServerServiceHandler_GetUpgrades
--- PASS: TestBareMetalServerServiceHandler_GetUpgrades (0.00s)
=== RUN   TestBareMetalServerServiceHandler_GetVNCUrl
--- PASS: TestBareMetalServerServiceHandler_GetVNCUrl (0.00s)
=== RUN   TestBareMetalServerServiceHandler_MassStart
--- PASS: TestBareMetalServerServiceHandler_MassStart (0.00s)
=== RUN   TestBareMetalServerServiceHandler_MassReboot
--- PASS: TestBareMetalServerServiceHandler_MassReboot (0.00s)
=== RUN   TestBareMetalServerServiceHandler_MassHalt
--- PASS: TestBareMetalServerServiceHandler_MassHalt (0.00s)
=== RUN   TestBareMetalServerServiceHandler_CreateMarketplaceImage
--- PASS: TestBareMetalServerServiceHandler_CreateMarketplaceImage (0.00s)
=== RUN   TestBillingServiceHandler_ListHistory
--- PASS: TestBillingServiceHandler_ListHistory (0.00s)
=== RUN   TestBillingServiceHandler_ListInvoices
--- PASS: TestBillingServiceHandler_ListInvoices (0.00s)
=== RUN   TestBillingServiceHandler_ListHistoryEmpty
--- PASS: TestBillingServiceHandler_ListHistoryEmpty (0.00s)
=== RUN   TestBillingServiceHandler_ListInvoicesEmpty
--- PASS: TestBillingServiceHandler_ListInvoicesEmpty (0.00s)
=== RUN   TestBillingServiceHandler_GetInvoice
--- PASS: TestBillingServiceHandler_GetInvoice (0.00s)
=== RUN   TestBillingServiceHandler_ListInvoiceItems
--- PASS: TestBillingServiceHandler_ListInvoiceItems (0.00s)
=== RUN   TestBlockStorageServiceHandler_Create
--- PASS: TestBlockStorageServiceHandler_Create (0.00s)
=== RUN   TestBlockStorageServiceHandler_Get
--- PASS: TestBlockStorageServiceHandler_Get (0.00s)
=== RUN   TestBlockStorageServiceHandler_Update
--- PASS: TestBlockStorageServiceHandler_Update (0.00s)
=== RUN   TestBlockStorageServiceHandler_Delete
--- PASS: TestBlockStorageServiceHandler_Delete (0.00s)
=== RUN   TestBlockStorageServiceHandler_List
--- PASS: TestBlockStorageServiceHandler_List (0.00s)
=== RUN   TestBlockStorageServiceHandler_Attach
--- PASS: TestBlockStorageServiceHandler_Attach (0.00s)
=== RUN   TestBlockStorageServiceHandler_Detach
--- PASS: TestBlockStorageServiceHandler_Detach (0.00s)
=== RUN   TestDomainRecordsServiceHandler_Create
--- PASS: TestDomainRecordsServiceHandler_Create (0.00s)
=== RUN   TestDomainRecordsServiceHandler_Get
--- PASS: TestDomainRecordsServiceHandler_Get (0.00s)
=== RUN   TestDomainRecordsServiceHandler_Update
--- PASS: TestDomainRecordsServiceHandler_Update (0.00s)
=== RUN   TestDomainRecordsServiceHandler_Delete
--- PASS: TestDomainRecordsServiceHandler_Delete (0.00s)
=== RUN   TestDomainRecordsServiceHandler_List
--- PASS: TestDomainRecordsServiceHandler_List (0.00s)
=== RUN   TestDomainServiceHandler_Create
--- PASS: TestDomainServiceHandler_Create (0.00s)
=== RUN   TestDomainServiceHandler_Get
--- PASS: TestDomainServiceHandler_Get (0.00s)
=== RUN   TestDomainServiceHandler_Update
--- PASS: TestDomainServiceHandler_Update (0.00s)
=== RUN   TestDomainServiceHandler_Delete
--- PASS: TestDomainServiceHandler_Delete (0.00s)
=== RUN   TestDNSDomainServiceHandler_List
--- PASS: TestDNSDomainServiceHandler_List (0.00s)
=== RUN   TestDomainServiceHandler_GetSoa
--- PASS: TestDomainServiceHandler_GetSoa (0.00s)
=== RUN   TestDNSDomainServiceHandler_UpdateSoa
--- PASS: TestDNSDomainServiceHandler_UpdateSoa (0.00s)
=== RUN   TestDNSDomainServiceHandler_DNSSecInfo
--- PASS: TestDNSDomainServiceHandler_DNSSecInfo (0.00s)
=== RUN   TestFireWallGroupServiceHandler_Create
--- PASS: TestFireWallGroupServiceHandler_Create (0.00s)
=== RUN   TestFireWallGroupServiceHandler_Get
--- PASS: TestFireWallGroupServiceHandler_Get (0.00s)
=== RUN   TestFireWallGroupServiceHandler_ChangeDescription
--- PASS: TestFireWallGroupServiceHandler_ChangeDescription (0.00s)
=== RUN   TestFireWallGroupServiceHandler_Delete
--- PASS: TestFireWallGroupServiceHandler_Delete (0.00s)
=== RUN   TestFireWallGroupServiceHandler_List
--- PASS: TestFireWallGroupServiceHandler_List (0.00s)
=== RUN   TestFireWallRuleServiceHandler_Create
--- PASS: TestFireWallRuleServiceHandler_Create (0.00s)
=== RUN   TestFireWallRuleServiceHandler_Delete
--- PASS: TestFireWallRuleServiceHandler_Delete (0.00s)
=== RUN   TestFireWallRuleServiceHandler_List
--- PASS: TestFireWallRuleServiceHandler_List (0.00s)
=== RUN   TestFireWallRuleServiceHandler_Get
--- PASS: TestFireWallRuleServiceHandler_Get (0.00s)
=== RUN   TestNewClient
--- PASS: TestNewClient (0.00s)
=== RUN   TestClient_DoWithContext
--- PASS: TestClient_DoWithContext (0.00s)
=== RUN   TestClient_DoWithContextFailure
--- PASS: TestClient_DoWithContextFailure (1.34s)
=== RUN   TestClient_DoWithContextError
--- PASS: TestClient_DoWithContextError (1.34s)
=== RUN   TestClient_NewRequest
--- PASS: TestClient_NewRequest (0.00s)
=== RUN   TestClient_SetBaseUrl
--- PASS: TestClient_SetBaseUrl (0.00s)
=== RUN   TestClient_SetUserAgent
--- PASS: TestClient_SetUserAgent (0.00s)
=== RUN   TestClient_SetRateLimit
--- PASS: TestClient_SetRateLimit (0.00s)
=== RUN   TestClient_OnRequestCompleted
--- PASS: TestClient_OnRequestCompleted (0.00s)
=== RUN   TestClient_SetRetryLimit
--- PASS: TestClient_SetRetryLimit (0.00s)
=== RUN   TestNewRequest_badURI
--- PASS: TestNewRequest_badURI (0.00s)
=== RUN   TestNewRequest_badBody
--- PASS: TestNewRequest_badBody (0.00s)
=== RUN   TestRequest_InvalidCall
--- PASS: TestRequest_InvalidCall (0.00s)
=== RUN   TestRequest_InvalidResponseBody
--- PASS: TestRequest_InvalidResponseBody (0.00s)
=== RUN   TestServerServiceHandler_GetBackupSchedule
--- PASS: TestServerServiceHandler_GetBackupSchedule (0.00s)
=== RUN   TestServerServiceHandler_SetBackupSchedule
--- PASS: TestServerServiceHandler_SetBackupSchedule (0.00s)
=== RUN   TestServerServiceHandler_RestoreBackup
--- PASS: TestServerServiceHandler_RestoreBackup (0.00s)
=== RUN   TestServerServiceHandler_RestoreSnapshot
--- PASS: TestServerServiceHandler_RestoreSnapshot (0.00s)
=== RUN   TestServerServiceHandler_Neighbors
--- PASS: TestServerServiceHandler_Neighbors (0.00s)
=== RUN   TestServerServiceHandler_ListPrivateNetworks
--- PASS: TestServerServiceHandler_ListPrivateNetworks (0.00s)
=== RUN   TestServerServiceHandler_ListVPCInfo
--- PASS: TestServerServiceHandler_ListVPCInfo (0.00s)
=== RUN   TestServerServiceHandler_GetUserData
--- PASS: TestServerServiceHandler_GetUserData (0.00s)
=== RUN   TestServerServiceHandler_ListIPv4
--- PASS: TestServerServiceHandler_ListIPv4 (0.00s)
=== RUN   TestServerServiceHandler_ListIPv6
--- PASS: TestServerServiceHandler_ListIPv6 (0.00s)
=== RUN   TestServerServiceHandler_CreateIPv4
--- PASS: TestServerServiceHandler_CreateIPv4 (0.00s)
=== RUN   TestServerServiceHandler_DestroyIPV4
--- PASS: TestServerServiceHandler_DestroyIPV4 (0.00s)
=== RUN   TestServerServiceHandler_GetBandwidth
--- PASS: TestServerServiceHandler_GetBandwidth (0.00s)
=== RUN   TestServerServiceHandler_ListReverseIPv6
--- PASS: TestServerServiceHandler_ListReverseIPv6 (0.00s)
=== RUN   TestServerServiceHandler_DefaultReverseIPv4
--- PASS: TestServerServiceHandler_DefaultReverseIPv4 (0.00s)
=== RUN   TestServerServiceHandler_DeleteReverseIPv6
--- PASS: TestServerServiceHandler_DeleteReverseIPv6 (0.00s)
=== RUN   TestServerServiceHandler_CreateReverseIPv4
--- PASS: TestServerServiceHandler_CreateReverseIPv4 (0.00s)
=== RUN   TestServerServiceHandler_CreateReverseIPv6
--- PASS: TestServerServiceHandler_CreateReverseIPv6 (0.00s)
=== RUN   TestServerServiceHandler_Halt
--- PASS: TestServerServiceHandler_Halt (0.00s)
=== RUN   TestServerServiceHandler_Start
--- PASS: TestServerServiceHandler_Start (0.00s)
=== RUN   TestServerServiceHandler_Reboot
--- PASS: TestServerServiceHandler_Reboot (0.00s)
=== RUN   TestServerServiceHandler_Reinstall
--- PASS: TestServerServiceHandler_Reinstall (0.00s)
=== RUN   TestServerServiceHandler_Delete
--- PASS: TestServerServiceHandler_Delete (0.00s)
=== RUN   TestServerServiceHandler_Create
--- PASS: TestServerServiceHandler_Create (0.00s)
=== RUN   TestServerServiceHandler_List
--- PASS: TestServerServiceHandler_List (0.00s)
=== RUN   TestServerServiceHandler_GetServer
--- PASS: TestServerServiceHandler_GetServer (0.00s)
=== RUN   TestInstanceServiceHandler_GetUpgrades
--- PASS: TestInstanceServiceHandler_GetUpgrades (0.00s)
=== RUN   TestServerServiceHandler_MassStart
--- PASS: TestServerServiceHandler_MassStart (0.00s)
=== RUN   TestServerServiceHandler_MassReboot
--- PASS: TestServerServiceHandler_MassReboot (0.00s)
=== RUN   TestServerServiceHandler_MassHalt
--- PASS: TestServerServiceHandler_MassHalt (0.00s)
=== RUN   TestServerServiceHandler_AttachPrivateNetwork
--- PASS: TestServerServiceHandler_AttachPrivateNetwork (0.00s)
=== RUN   TestServerServiceHandler_DetachPrivateNetwork
--- PASS: TestServerServiceHandler_DetachPrivateNetwork (0.00s)
=== RUN   TestServerServiceHandler_AttachVPC
--- PASS: TestServerServiceHandler_AttachVPC (0.00s)
=== RUN   TestServerServiceHandler_DetachVPC
--- PASS: TestServerServiceHandler_DetachVPC (0.00s)
=== RUN   TestServerServiceHandler_ISOAttach
--- PASS: TestServerServiceHandler_ISOAttach (0.00s)
=== RUN   TestServerServiceHandler_ISODetach
--- PASS: TestServerServiceHandler_ISODetach (0.00s)
=== RUN   TestServerServiceHandler_ISO
--- PASS: TestServerServiceHandler_ISO (0.00s)
=== RUN   TestServerServiceHandler_Update
--- PASS: TestServerServiceHandler_Update (0.00s)
=== RUN   TestServerServiceHandler_CreateMarketplace
--- PASS: TestServerServiceHandler_CreateMarketplace (0.00s)
=== RUN   TestIsoServiceHandler_Create
--- PASS: TestIsoServiceHandler_Create (0.00s)
=== RUN   TestIsoServiceHandler_Get
--- PASS: TestIsoServiceHandler_Get (0.00s)
=== RUN   TestIsoServiceHandler_Delete
--- PASS: TestIsoServiceHandler_Delete (0.00s)
=== RUN   TestIsoServiceHandler_List
--- PASS: TestIsoServiceHandler_List (0.00s)
=== RUN   TestIsoServiceHandler_ListPublic
--- PASS: TestIsoServiceHandler_ListPublic (0.00s)
=== RUN   TestKubernetesHandler_CreateCluster
--- PASS: TestKubernetesHandler_CreateCluster (0.00s)
=== RUN   TestKubernetesHandler_GetCluster
--- PASS: TestKubernetesHandler_GetCluster (0.00s)
=== RUN   TestKubernetesHandler_ListClusters
--- PASS: TestKubernetesHandler_ListClusters (0.00s)
=== RUN   TestKubernetesHandler_UpdateCluster
--- PASS: TestKubernetesHandler_UpdateCluster (0.00s)
=== RUN   TestKubernetesHandler_DeleteCluster
--- PASS: TestKubernetesHandler_DeleteCluster (0.00s)
=== RUN   TestKubernetesHandler_DeleteClusterWithResources
--- PASS: TestKubernetesHandler_DeleteClusterWithResources (0.00s)
=== RUN   TestKubernetesHandler_CreateNodePool
--- PASS: TestKubernetesHandler_CreateNodePool (0.00s)
=== RUN   TestKubernetesHandler_GetNodePool
--- PASS: TestKubernetesHandler_GetNodePool (0.00s)
=== RUN   TestKubernetesHandler_ListNodePools
--- PASS: TestKubernetesHandler_ListNodePools (0.00s)
=== RUN   TestKubernetesHandler_UpdateNodePool
--- PASS: TestKubernetesHandler_UpdateNodePool (0.00s)
=== RUN   TestKubernetesHandler_DeleteNodePool
--- PASS: TestKubernetesHandler_DeleteNodePool (0.00s)
=== RUN   TestKubernetesHandler_DeleteNodePoolInstance
--- PASS: TestKubernetesHandler_DeleteNodePoolInstance (0.00s)
=== RUN   TestKubernetesHandler_RecycleNodePoolInstance
--- PASS: TestKubernetesHandler_RecycleNodePoolInstance (0.00s)
=== RUN   TestKubernetesHandler_GetKubeConfig
--- PASS: TestKubernetesHandler_GetKubeConfig (0.00s)
=== RUN   TestKubernetesHandler_GetVersions
--- PASS: TestKubernetesHandler_GetVersions (0.00s)
=== RUN   TestKubernetesHandler_GetUpgrades
--- PASS: TestKubernetesHandler_GetUpgrades (0.00s)
=== RUN   TestKubernetesHandler_Upgrade
--- PASS: TestKubernetesHandler_Upgrade (0.00s)
=== RUN   TestLoadBalancerHandler_List
--- PASS: TestLoadBalancerHandler_List (0.00s)
=== RUN   TestLoadBalancerHandler_Delete
--- PASS: TestLoadBalancerHandler_Delete (0.00s)
=== RUN   TestLoadBalancerHandler_Get
--- PASS: TestLoadBalancerHandler_Get (0.00s)
=== RUN   TestLoadBalancerHandler_ListForwardingRules
--- PASS: TestLoadBalancerHandler_ListForwardingRules (0.00s)
=== RUN   TestLoadBalancerHandler_DeleteForwardingRule
--- PASS: TestLoadBalancerHandler_DeleteForwardingRule (0.00s)
=== RUN   TestLoadBalancerHandler_CreateForwardingRule
--- PASS: TestLoadBalancerHandler_CreateForwardingRule (0.00s)
=== RUN   TestLoadBalancerHandler_Create
--- PASS: TestLoadBalancerHandler_Create (0.00s)
=== RUN   TestLoadBalancerHandler_Update
--- PASS: TestLoadBalancerHandler_Update (0.00s)
=== RUN   TestLoadBalancerHandler_GetFowardingRule
--- PASS: TestLoadBalancerHandler_GetFowardingRule (0.00s)
=== RUN   TestLoadBalancerHandler_GetFirewallRule
--- PASS: TestLoadBalancerHandler_GetFirewallRule (0.00s)
=== RUN   TestMeta
--- PASS: TestMeta (0.00s)
=== RUN   TestNetworkServiceHandler_Create
--- PASS: TestNetworkServiceHandler_Create (0.00s)
=== RUN   TestNetworkServiceHandler_Delete
--- PASS: TestNetworkServiceHandler_Delete (0.00s)
=== RUN   TestNetworkServiceHandler_List
--- PASS: TestNetworkServiceHandler_List (0.00s)
=== RUN   TestNetworkServiceHandler_Update
--- PASS: TestNetworkServiceHandler_Update (0.00s)
=== RUN   TestNetworkServiceHandler_Get
--- PASS: TestNetworkServiceHandler_Get (0.00s)
=== RUN   TestObjectStorageServiceHandler_Create
--- PASS: TestObjectStorageServiceHandler_Create (0.00s)
=== RUN   TestObjectStorageServiceHandler_Get
--- PASS: TestObjectStorageServiceHandler_Get (0.00s)
=== RUN   TestObjectStorageServiceHandler_Update
--- PASS: TestObjectStorageServiceHandler_Update (0.00s)
=== RUN   TestObjectStorageServiceHandler_Delete
--- PASS: TestObjectStorageServiceHandler_Delete (0.00s)
=== RUN   TestObjectStorageServiceHandler_List
--- PASS: TestObjectStorageServiceHandler_List (0.00s)
=== RUN   TestObjectStorageServiceHandler_ListCluster
--- PASS: TestObjectStorageServiceHandler_ListCluster (0.00s)
=== RUN   TestObjectStorageServiceHandler_RegenerateKeys
--- PASS: TestObjectStorageServiceHandler_RegenerateKeys (0.00s)
=== RUN   TestOSServiceHandler_List
--- PASS: TestOSServiceHandler_List (0.00s)
=== RUN   TestPlanServiceHandler_List
--- PASS: TestPlanServiceHandler_List (0.00s)
=== RUN   TestPlanServiceHandler_GetBareMetalList
--- PASS: TestPlanServiceHandler_GetBareMetalList (0.00s)
=== RUN   TestRegionServiceHandler_List
--- PASS: TestRegionServiceHandler_List (0.00s)
=== RUN   TestRegionServiceHandler_Availability
--- PASS: TestRegionServiceHandler_Availability (0.00s)
=== RUN   TestReservedIPServiceHandler_Attach
--- PASS: TestReservedIPServiceHandler_Attach (0.00s)
=== RUN   TestReservedIPServiceHandler_Convert
--- PASS: TestReservedIPServiceHandler_Convert (0.00s)
=== RUN   TestReservedIPServiceHandler_Create
--- PASS: TestReservedIPServiceHandler_Create (0.00s)
=== RUN   TestReservedIPServiceHandler_Delete
--- PASS: TestReservedIPServiceHandler_Delete (0.00s)
=== RUN   TestReservedIPServiceHandler_Detach
--- PASS: TestReservedIPServiceHandler_Detach (0.00s)
=== RUN   TestReservedIPServiceHandler_Get
--- PASS: TestReservedIPServiceHandler_Get (0.00s)
=== RUN   TestReservedIPServiceHandler_List
--- PASS: TestReservedIPServiceHandler_List (0.00s)
=== RUN   TestSnapshotServiceHandler_Create
--- PASS: TestSnapshotServiceHandler_Create (0.00s)
=== RUN   TestSnapshotServiceHandler_CreateFromURL
--- PASS: TestSnapshotServiceHandler_CreateFromURL (0.00s)
=== RUN   TestSnapshotServiceHandler_Get
--- PASS: TestSnapshotServiceHandler_Get (0.00s)
=== RUN   TestSnapshotServiceHandler_Delete
--- PASS: TestSnapshotServiceHandler_Delete (0.00s)
=== RUN   TestSnapshotServiceHandler_List
--- PASS: TestSnapshotServiceHandler_List (0.00s)
=== RUN   TestSSHKeyServiceHandler_Create
--- PASS: TestSSHKeyServiceHandler_Create (0.00s)
=== RUN   TestSSHKeyServiceHandler_Get
--- PASS: TestSSHKeyServiceHandler_Get (0.00s)
=== RUN   TestSSHKeyServiceHandler_Update
--- PASS: TestSSHKeyServiceHandler_Update (0.00s)
=== RUN   TestSSHKeyServiceHandler_Delete
--- PASS: TestSSHKeyServiceHandler_Delete (0.00s)
=== RUN   TestSSHKeyServiceHandler_List
--- PASS: TestSSHKeyServiceHandler_List (0.00s)
=== RUN   TestStartupScriptServiceHandler_Create
--- PASS: TestStartupScriptServiceHandler_Create (0.00s)
=== RUN   TestStartupScriptServiceHandler_GET
--- PASS: TestStartupScriptServiceHandler_GET (0.00s)
=== RUN   TestStartupScriptServiceHandler_Update
--- PASS: TestStartupScriptServiceHandler_Update (0.00s)
=== RUN   TestStartupScriptServiceHandler_Delete
--- PASS: TestStartupScriptServiceHandler_Delete (0.00s)
=== RUN   TestStartupScriptServiceHandler_List
--- PASS: TestStartupScriptServiceHandler_List (0.00s)
=== RUN   TestUserServiceHandler_Create
--- PASS: TestUserServiceHandler_Create (0.00s)
=== RUN   TestUserServiceHandler_Delete
--- PASS: TestUserServiceHandler_Delete (0.00s)
=== RUN   TestUserServiceHandler_List
--- PASS: TestUserServiceHandler_List (0.00s)
=== RUN   TestUserServiceHandler_Update
--- PASS: TestUserServiceHandler_Update (0.00s)
=== RUN   TestUserServiceHandler_Get
--- PASS: TestUserServiceHandler_Get (0.00s)
=== RUN   TestVPCServiceHandler_Create
--- PASS: TestVPCServiceHandler_Create (0.00s)
=== RUN   TestVPCServiceHandler_Delete
--- PASS: TestVPCServiceHandler_Delete (0.00s)
=== RUN   TestVPCServiceHandler_List
--- PASS: TestVPCServiceHandler_List (0.00s)
=== RUN   TestVPCServiceHandler_Update
--- PASS: TestVPCServiceHandler_Update (0.00s)
=== RUN   TestVPCServiceHandler_Get
--- PASS: TestVPCServiceHandler_Get (0.00s)
PASS
coverage: 77.0% of statements
ok  	github.com/vultr/govultr/v2	2.768s

Pusher: @optik-aper, Action: pull_request_target

@optik-aper
Copy link
Member Author

Commit fbb7899 updates the tag field on update calls to "omitempty" so that we don't send null in the body when the value is undefined. It also changes the auto_scaler type to "omitempty" as well for the same reason.

Testing

Tag

There are three test cases:

  • Where Tag has an actual tag in the update
  • Tag is deleting the tag value with ""
  • And Tag is not sent in the update

With tag

On node pools:

func vkeNodePoolUpdate(client *govultr.Client, ctx context.Context) {
	var clusterID string = "ec9c6ba7-5182-4fcd-8091-d5e65f677dfa"
	var nodePoolID string = "963a698c-1270-4411-ae19-af2fb0f17ccb"
	np, err := client.Kubernetes.UpdateNodePool(ctx, clusterID, nodePoolID, &govultr.NodePoolReqUpdate{
		Tag: govultr.StringToStringPtr("test-tag"),
	})

	if err != nil {
		fmt.Println(err)
		panic(err.Error())
	}

	printJson(np)
}

Which generates a request body:

{"tag":"test-tag"}

And updates the tag as expected:

{
	"id": "963a698c-1270-4411-ae19-af2fb0f17ccb",
	"date_created": "2022-05-16T19:31:11+00:00",
	"date_updated": "2022-05-17T13:44:46+00:00",
	"label": "np-tag-reset",
	"plan": "voc-c-2c-4gb-75s-amd",
	"status": "active",
	"node_quantity": 3,
	"min_nodes": 1,
	"max_nodes": 1,
	"auto_scaler": false,
	"tag": "test-tag",
	"nodes": [
		{
			"id": "af4830f3-1886-4434-ad12-43849e24b3a3",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-584bd1ebbf15",
			"status": "active"
		},
		{
			"id": "7c52abc0-5bcd-494f-ba54-b57989fbe1f5",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-90b3ae63f540",
			"status": "active"
		},
		{
			"id": "48b42054-d099-49e1-8900-b7e4ef46f976",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-e31a47a6fcd8",
			"status": "active"
		}
	]
}

On instances:

func instUpdate(client *govultr.Client, ctx context.Context) {

	instID := "9c89193b-21af-4269-9212-96d7acb19145"

	inst, err := client.Instance.Update(ctx, instID, &govultr.InstanceUpdateReq{
		Tag: govultr.StringToStringPtr("test-tag"),
	})

	if err != nil {
		fmt.Println(err)
		panic(err.Error())
	}

	printJson(inst)
}

Which generates this body:

{"tag":"test-tag","tags":null,"ddos_protection":null}

And updates the tag as expected:

{
	"id": "9c89193b-21af-4269-9212-96d7acb19145",
	"os": "Debian 11 x64 (bullseye)",
	"ram": 1024,
	"disk": 0,
	"plan": "vc2-1c-1gb",
	"main_ip": "108.61.86.208",
	"vcpu_count": 1,
	"region": "ewr",
	"date_created": "2022-05-16T16:20:53+00:00",
	"status": "active",
	"allowed_bandwidth": 1000,
	"netmask_v4": "255.255.254.0",
	"gateway_v4": "108.61.86.1",
	"power_status": "running",
	"server_status": "ok",
	"v6_network": "",
	"v6_main_ip": "",
	"v6_network_size": 0,
	"label": "testest",
	"internal_ip": "",
	"kvm": "https://my.vultr.com/subs/vps/novnc/api.php?data=djJ8dVF2TEF6SUZGd2FYZnBRalkwV2tPam5oQk1rSjFKQmV8kV-Ofe4U6-tqKMpsdHYdWcbPTn_O_NP3cjOxdgWGYri3ppITVHqg54DzWjpj7mClzSf6VCjZ-qGRuNshzS7lJAFkUt1AypcKvDNXROfGTrqDFgxB26SbK285gwCKujdfcNXfV_UyKyReG_cl2PFE9mm5KCcFylBTXqDVOxJdbAJU9k-AoC7r7gxjIY2kTdEZrA5T-39QX9OY",
	"tag": "test-tag",
	"os_id": 477,
	"app_id": 0,
	"image_id": "",
	"firewall_group_id": "",
	"features": [],
	"hostname": "vultr.guest",
	"tags": []
}

On bare metal:

func bmUpdate(client *govultr.Client, ctx context.Context) {

	bmID := "7ea675a7-db61-40cc-aa68-9135ead25352"

	bm, err := client.BareMetalServer.Update(ctx, bmID, &govultr.BareMetalUpdate{
		Tag: govultr.StringToStringPtr("test-tag"),
	})

	if err != nil {
		fmt.Println(err)
		panic(err.Error())
	}

	printJson(bm)
}

Which generates this request body:

{"tag":"test-tag","tags":null}

And updates the tag as expected:

{
	"id": "7ea675a7-db61-40cc-aa68-9135ead25352",
	"os": "Debian 11 x64 (bullseye)",
	"ram": "32768 MB",
	"disk": "2x 240GB SSD",
	"main_ip": "149.248.9.242",
	"cpu_count": 4,
	"region": "lax",
	"default_password": "",
	"date_created": "2022-05-17T14:10:02+00:00",
	"status": "pending",
	"netmask_v4": "255.255.254.0",
	"gateway_v4": "149.248.8.1",
	"plan": "vbm-4c-32gb",
	"v6_network": "2001:19f0:6001:775::",
	"v6_main_ip": "2001:19f0:6001:0775:0ec4:7aff:fe8f:679f",
	"v6_network_size": 64,
	"mac_address": 14038009341855,
	"label": "test-bm-tags",
	"tag": "test-tag",
	"os_id": 477,
	"app_id": 0,
	"image_id": "",
	"features": [
		"ipv6"
	],
	"tags": []
}

With empty string

On node pools:

np, err := client.Kubernetes.UpdateNodePool(ctx, clusterID, nodePoolID, &govultr.NodePoolReqUpdate{
	Tag: govultr.StringToStringPtr(""),
})

Which generates this request body:

{"tag":""}

And removes the tag on the node pool:

{
	"id": "963a698c-1270-4411-ae19-af2fb0f17ccb",
	"date_created": "2022-05-16T19:31:11+00:00",
	"date_updated": "2022-05-17T13:47:04+00:00",
	"label": "np-tag-reset",
	"plan": "voc-c-2c-4gb-75s-amd",
	"status": "active",
	"node_quantity": 3,
	"min_nodes": 1,
	"max_nodes": 1,
	"auto_scaler": false,
	"tag": "",
	"nodes": [
		{
			"id": "af4830f3-1886-4434-ad12-43849e24b3a3",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-584bd1ebbf15",
			"status": "active"
		},
		{
			"id": "7c52abc0-5bcd-494f-ba54-b57989fbe1f5",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-90b3ae63f540",
			"status": "active"
		},
		{
			"id": "48b42054-d099-49e1-8900-b7e4ef46f976",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-e31a47a6fcd8",
			"status": "active"
		}
	]
}

On instances:

inst, err := client.Instance.Update(ctx, instID, &govultr.InstanceUpdateReq{
	Tag: govultr.StringToStringPtr(""),
})

Which generates this request body:

{"tag":"","tags":null,"ddos_protection":null}

And removes the tag:

{
	"id": "9c89193b-21af-4269-9212-96d7acb19145",
	"os": "Debian 11 x64 (bullseye)",
	"ram": 1024,
	"disk": 0,
	"plan": "vc2-1c-1gb",
	"main_ip": "108.61.86.208",
	"vcpu_count": 1,
	"region": "ewr",
	"date_created": "2022-05-16T16:20:53+00:00",
	"status": "active",
	"allowed_bandwidth": 1000,
	"netmask_v4": "255.255.254.0",
	"gateway_v4": "108.61.86.1",
	"power_status": "running",
	"server_status": "ok",
	"v6_network": "",
	"v6_main_ip": "",
	"v6_network_size": 0,
	"label": "testest",
	"internal_ip": "",
	"kvm": "https://my.vultr.com/subs/vps/novnc/api.php?data=djJ8dVF2TEF6SUZGd2FYZnBRalkwV2tPam5oQk1rSjFKQmV8kV-Ofe4U6-tqKMpsdHYdWcbPTn_O_NP3cjOxdgWGYri3ppITVHqg54DzWjpj7mClzSf6VCjZ-qGRuNshzS7lJAFkUt1AypcKvDNXROfGTrqDFgxB26SbK285gwCKujdfcNXfV_UyKyReG_cl2PFE9mm5KCcFylBTXqDVOxJdbAJU9k-AoC7r7gxjIY2kTdEZrA5T-39QX9OY",
	"tag": "",
	"os_id": 477,
	"app_id": 0,
	"image_id": "",
	"firewall_group_id": "",
	"features": [],
	"hostname": "vultr.guest",
	"tags": []
}

On bare metal:

bm, err := client.BareMetalServer.Update(ctx, bmID, &govultr.BareMetalUpdate{
	Tag: govultr.StringToStringPtr(""),
})

Which generates this request body:

{"tag":"","tags":null}

And removes the tag as expected:

{
	"id": "7ea675a7-db61-40cc-aa68-9135ead25352",
	"os": "Debian 11 x64 (bullseye)",
	"ram": "32768 MB",
	"disk": "2x 240GB SSD",
	"main_ip": "149.248.9.242",
	"cpu_count": 4,
	"region": "lax",
	"default_password": "",
	"date_created": "2022-05-17T14:10:02+00:00",
	"status": "active",
	"netmask_v4": "255.255.254.0",
	"gateway_v4": "149.248.8.1",
	"plan": "vbm-4c-32gb",
	"v6_network": "2001:19f0:6001:775::",
	"v6_main_ip": "2001:19f0:6001:0775:0ec4:7aff:fe8f:679f",
	"v6_network_size": 64,
	"mac_address": 14038009341855,
	"label": "test-bm-tags",
	"tag": "",
	"os_id": 477,
	"app_id": 0,
	"image_id": "",
	"features": [
		"ipv6"
	],
	"tags": []
}

With an empty struct

On node pools:

np, err := client.Kubernetes.UpdateNodePool(ctx, clusterID, nodePoolID, &govultr.NodePoolReqUpdate{})

Genereates an empty body:

{}

And does nothing to the node pool:

{
	"id": "963a698c-1270-4411-ae19-af2fb0f17ccb",
	"date_created": "2022-05-16T19:31:11+00:00",
	"date_updated": "2022-05-17T14:04:35+00:00",
	"label": "np-tag-reset",
	"plan": "voc-c-2c-4gb-75s-amd",
	"status": "active",
	"node_quantity": 3,
	"min_nodes": 1,
	"max_nodes": 1,
	"auto_scaler": false,
	"tag": "test-tag2",
	"nodes": [
		{
			"id": "af4830f3-1886-4434-ad12-43849e24b3a3",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-584bd1ebbf15",
			"status": "active"
		},
		{
			"id": "7c52abc0-5bcd-494f-ba54-b57989fbe1f5",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-90b3ae63f540",
			"status": "active"
		},
		{
			"id": "48b42054-d099-49e1-8900-b7e4ef46f976",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-e31a47a6fcd8",
			"status": "active"
		}
	]
}

On instances:

inst, err := client.Instance.Update(ctx, instID, &govultr.InstanceUpdateReq{})

Which generates this request body:

{"tags":null,"ddos_protection":null}

And does not update the tag:

{
	"id": "9c89193b-21af-4269-9212-96d7acb19145",
	"os": "Debian 11 x64 (bullseye)",
	"ram": 1024,
	"disk": 0,
	"plan": "vc2-1c-1gb",
	"main_ip": "108.61.86.208",
	"vcpu_count": 1,
	"region": "ewr",
	"date_created": "2022-05-16T16:20:53+00:00",
	"status": "active",
	"allowed_bandwidth": 1000,
	"netmask_v4": "255.255.254.0",
	"gateway_v4": "108.61.86.1",
	"power_status": "running",
	"server_status": "ok",
	"v6_network": "",
	"v6_main_ip": "",
	"v6_network_size": 0,
	"label": "testest",
	"internal_ip": "",
	"kvm": "https://my.vultr.com/subs/vps/novnc/api.php?data=djJ8dVF2TEF6SUZGd2FYZnBRalkwV2tPam5oQk1rSjFKQmV8kV-Ofe4U6-tqKMpsdHYdWcbPTn_O_NP3cjOxdgWGYri3ppITVHqg54DzWjpj7mClzSf6VCjZ-qGRuNshzS7lJAFkUt1AypcKvDNXROfGTrqDFgxB26SbK285gwCKujdfcNXfV_UyKyReG_cl2PFE9mm5KCcFylBTXqDVOxJdbAJU9k-AoC7r7gxjIY2kTdEZrA5T-39QX9OY",
	"tag": "test-tag2",
	"os_id": 477,
	"app_id": 0,
	"image_id": "",
	"firewall_group_id": "",
	"features": [],
	"hostname": "vultr.guest",
	"tags": []
}

On bare metal:

bm, err := client.BareMetalServer.Update(ctx, bmID, &govultr.BareMetalUpdate{})

Generates this body in the request:

{"tags":null}

And does not affect the tag on the server:

{
	"id": "7ea675a7-db61-40cc-aa68-9135ead25352",
	"os": "Debian 11 x64 (bullseye)",
	"ram": "32768 MB",
	"disk": "2x 240GB SSD",
	"main_ip": "149.248.9.242",
	"cpu_count": 4,
	"region": "lax",
	"default_password": "",
	"date_created": "2022-05-17T14:10:02+00:00",
	"status": "active",
	"netmask_v4": "255.255.254.0",
	"gateway_v4": "149.248.8.1",
	"plan": "vbm-4c-32gb",
	"v6_network": "2001:19f0:6001:775::",
	"v6_main_ip": "2001:19f0:6001:0775:0ec4:7aff:fe8f:679f",
	"v6_network_size": 64,
	"mac_address": 14038009341855,
	"label": "test-bm-tags",
	"tag": "test-tag2",
	"os_id": 477,
	"app_id": 0,
	"image_id": "",
	"features": [
		"ipv6"
	],
	"tags": []
}

AutoScaler on node pools

This is a *boolean which is also not set to omitempty in the updates. To test:

  • A true value should update to match
  • A false value should update to match
  • An empty struct (undefined value) should do nothing

With true

With:

func vkeNodePoolUpdate(client *govultr.Client, ctx context.Context) {
	var clusterID string = "ec9c6ba7-5182-4fcd-8091-d5e65f677dfa"
	var nodePoolID string = "963a698c-1270-4411-ae19-af2fb0f17ccb"
	var autoScaler bool = true

	np, err := client.Kubernetes.UpdateNodePool(ctx, clusterID, nodePoolID, &govultr.NodePoolReqUpdate{
		AutoScaler:   &autoScaler,
	})

	if err != nil {
		fmt.Println(err)
		panic(err.Error())
	}

	printJson(np)
}

Generates this for the request body:

{"auto_scaler":true}

And results in this update:

{
	"id": "963a698c-1270-4411-ae19-af2fb0f17ccb",
	"date_created": "2022-05-16T19:31:11+00:00",
	"date_updated": "2022-05-17T15:00:54+00:00",
	"label": "np-tag-reset",
	"plan": "voc-c-2c-4gb-75s-amd",
	"status": "active",
	"node_quantity": 3,
	"min_nodes": 1,
	"max_nodes": 1,
	"auto_scaler": true,
	"tag": "test-tag2",
	"nodes": [
		{
			"id": "af4830f3-1886-4434-ad12-43849e24b3a3",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-584bd1ebbf15",
			"status": "active"
		},
		{
			"id": "7c52abc0-5bcd-494f-ba54-b57989fbe1f5",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-90b3ae63f540",
			"status": "active"
		},
		{
			"id": "48b42054-d099-49e1-8900-b7e4ef46f976",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-e31a47a6fcd8",
			"status": "active"
		}
	]
}

With false

With:

var autoScaler bool = false

np, err := client.Kubernetes.UpdateNodePool(ctx, clusterID, nodePoolID, &govultr.NodePoolReqUpdate{
	AutoScaler:   &autoScaler,
})

Generates this body:

{"auto_scaler":false}

And results in the value set to false:

{
	"id": "963a698c-1270-4411-ae19-af2fb0f17ccb",
	"date_created": "2022-05-16T19:31:11+00:00",
	"date_updated": "2022-05-17T15:04:20+00:00",
	"label": "np-tag-reset",
	"plan": "voc-c-2c-4gb-75s-amd",
	"status": "active",
	"node_quantity": 3,
	"min_nodes": 1,
	"max_nodes": 1,
	"auto_scaler": false,
	"tag": "test-tag2",
	"nodes": [
		{
			"id": "af4830f3-1886-4434-ad12-43849e24b3a3",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-584bd1ebbf15",
			"status": "active"
		},
		{
			"id": "7c52abc0-5bcd-494f-ba54-b57989fbe1f5",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-90b3ae63f540",
			"status": "active"
		},
		{
			"id": "48b42054-d099-49e1-8900-b7e4ef46f976",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-e31a47a6fcd8",
			"status": "active"
		}
	]
}

Empty/Undefined

With:

np, err := client.Kubernetes.UpdateNodePool(ctx, clusterID, nodePoolID, &govultr.NodePoolReqUpdate{})

Generates this body:

{}

And results in a value of true remaining set:

{
	"id": "963a698c-1270-4411-ae19-af2fb0f17ccb",
	"date_created": "2022-05-16T19:31:11+00:00",
	"date_updated": "2022-05-17T15:07:51+00:00",
	"label": "np-tag-reset",
	"plan": "voc-c-2c-4gb-75s-amd",
	"status": "active",
	"node_quantity": 3,
	"min_nodes": 1,
	"max_nodes": 1,
	"auto_scaler": true,
	"tag": "test-tag2",
	"nodes": [
		{
			"id": "af4830f3-1886-4434-ad12-43849e24b3a3",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-584bd1ebbf15",
			"status": "active"
		},
		{
			"id": "7c52abc0-5bcd-494f-ba54-b57989fbe1f5",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-90b3ae63f540",
			"status": "active"
		},
		{
			"id": "48b42054-d099-49e1-8900-b7e4ef46f976",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-e31a47a6fcd8",
			"status": "active"
		}
	]
}

As well as a value of false remaining set:

{
	"id": "963a698c-1270-4411-ae19-af2fb0f17ccb",
	"date_created": "2022-05-16T19:31:11+00:00",
	"date_updated": "2022-05-17T15:04:20+00:00",
	"label": "np-tag-reset",
	"plan": "voc-c-2c-4gb-75s-amd",
	"status": "active",
	"node_quantity": 3,
	"min_nodes": 1,
	"max_nodes": 1,
	"auto_scaler": false,
	"tag": "test-tag2",
	"nodes": [
		{
			"id": "af4830f3-1886-4434-ad12-43849e24b3a3",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-584bd1ebbf15",
			"status": "active"
		},
		{
			"id": "7c52abc0-5bcd-494f-ba54-b57989fbe1f5",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-90b3ae63f540",
			"status": "active"
		},
		{
			"id": "48b42054-d099-49e1-8900-b7e4ef46f976",
			"date_created": "2022-05-16T19:31:11+00:00",
			"label": "np-tag-reset-e31a47a6fcd8",
			"status": "active"
		}
	]
}

Copy link
Contributor

@ddymko ddymko left a comment

Choose a reason for hiding this comment

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

tested locally - looks good

@ddymko ddymko merged commit b5d8037 into vultr:master May 17, 2022
@optik-aper optik-aper mentioned this pull request May 17, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants