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 {