From ab1717df59ced289d46dd402c5d18cae284902fc Mon Sep 17 00:00:00 2001 From: Brett Wright Date: Tue, 2 Mar 2021 09:19:44 +0100 Subject: [PATCH] fixed bug with creating project --- client/project.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/project.go b/client/project.go index 4ead535..1aa312a 100644 --- a/client/project.go +++ b/client/project.go @@ -10,11 +10,18 @@ import ( // ProjectBody return a json body func ProjectBody(d *schema.ResourceData) models.ProjectsBodyPost { + quota := d.Get("storage_quota").(int) + body := models.ProjectsBodyPost{ ProjectName: d.Get("name").(string), RegistryID: d.Get("registry_id").(int), - StorageLimit: d.Get("storage_quota").(int) * 1073741824, + StorageLimit: quota, + } + + if quota != -1 { + body.StorageLimit = quota * 1073741824 } + body.Metadata.AutoScan = strconv.FormatBool(d.Get("vulnerability_scanning").(bool)) body.Metadata.Public = d.Get("public").(string)