Skip to content

Commit

Permalink
fixed bug with creating project
Browse files Browse the repository at this point in the history
  • Loading branch information
wrighbr committed Mar 2, 2021
1 parent 9c7e0f4 commit ab1717d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit ab1717d

Please sign in to comment.