From 193726574d3e0b942d260fb4f69ad7810c0653d2 Mon Sep 17 00:00:00 2001 From: Chris Morse Date: Tue, 24 Oct 2023 13:51:59 -0400 Subject: [PATCH] Adjust DBaaS VPC pointer to detect changes --- cmd/database.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/database.go b/cmd/database.go index 3a210e55..4dc30f9e 100644 --- a/cmd/database.go +++ b/cmd/database.go @@ -510,6 +510,7 @@ var databaseUpdate = &cobra.Command{ label, _ := cmd.Flags().GetString("label") tag, _ := cmd.Flags().GetString("tag") vpc, _ := cmd.Flags().GetString("vpc-id") + vpcSet := cmd.Flags().Lookup("vpc-id").Changed maintenanceDOW, _ := cmd.Flags().GetString("maintenance-dow") maintenanceTime, _ := cmd.Flags().GetString("maintenance-time") clusterTimeZone, _ := cmd.Flags().GetString("cluster-time-zone") @@ -527,7 +528,6 @@ var databaseUpdate = &cobra.Command{ Plan: plan, Label: label, Tag: tag, - VPCID: govultr.StringToStringPtr(vpc), MaintenanceDOW: maintenanceDOW, MaintenanceTime: maintenanceTime, ClusterTimeZone: clusterTimeZone, @@ -537,6 +537,10 @@ var databaseUpdate = &cobra.Command{ RedisEvictionPolicy: redisEvictionPolicy, } + if vpcSet { + opt.VPCID = govultr.StringToStringPtr(vpc) + } + if mysqlRequirePrimaryKeySet && mysqlRequirePrimaryKey { opt.MySQLRequirePrimaryKey = govultr.BoolToBoolPtr(true) } else if mysqlRequirePrimaryKeySet && !mysqlRequirePrimaryKey {